Showing posts with label remove. Show all posts
Showing posts with label remove. Show all posts

Monday, January 11, 2016

Remove multiple objects with similar names in R

I have a bunch of objects in the R environment, with names as: file_01, file_02, ... etc.
To remove these objects by using just one line of code, here's one solution:
rm(file_01, file_02,...)
However, if the number of files is too large, it is not practical to type in all the file names. Here's a solution to remove these objects, again by using just one line of code:
rm(list=ls(patter='file'))

Thursday, February 28, 2013

Matlab: Remove a cell element from a cell array

Similar to the method to remove unwanted element in a matrix, which is discussed in details in another post (http://matlabnewbie.blogspot.com/2009/07/matlab-remove-all-unwatned-elements-in.html), the unwanted cell element can be removed from a cell array. The only difference is that the strcmp function should be used to identify where all those unwanted cells are.

The following example shows how to remove the cell 'good' from the cell array a, to be somehow humble.

a=[{'this'},{'is'},{'a'},{'good'},{'matlab'},{'blog'}];                 % create a cell array
a=a(~strcmp(a, 'good'))                                                          % remove the 'good' cell

Result looks like this:


a = 

    'this'    'is'    'a'    'matlab'    'blog'

my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...