Showing posts with label matlab. Show all posts
Showing posts with label matlab. Show all posts

Thursday, September 19, 2013

windrose plot by sigmaplot and matlab

I used two methods to plot wind direction and speed data: Sigmaplot and Matlab.
To correctly show the wind is blowing from the degree, say 10 degree, I need to check the 'clock wise' option. Otherwise the direction will be wrong.
When I used the wind_rose.m, which is downloaded from this link:
http://www.mathworks.com/matlabcentral/fileexchange/17748-windrose
the correct way is to use D-180, and set the 'dtype' to 'meteo'.

This way the two plots made by two different methods will be consistent and correct.

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'

Wednesday, February 27, 2013

Set the properties of a dataset array in Matlab

The percent sign, %, can be used in the matlab code to add explanatory information to the code. Similarly, we can add explanatory information to a dataset array, by using the dataset array properties. The set function can be used to assign values to the dataset property, and the get function can be used to access these information.

DS=dataset(...) % a dataset array is constructed
DS=set(DS, 'Description', 'Whatever can describe the dataset can be put here');
get(DS) % show dataset array properties
summary(DS) % also show dataset array properties 

The 'Description' can be replaced with other properties which are displayed by the get function. 

Thursday, August 12, 2010

my-alpine and docker-compose.yml

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