Answered
plotyy and Property Editor
you can save the handles to the two axes and then reuse them with, e.g. <http://www.mathworks.co.uk/help/techdoc/ref/inspect.htm...

13 years ago | 0

Answered
constructing sequence of dates taking into account the calendar year
datestr(datenum(2008,11:100,28),'dd/mm/yy') Adjust the length of the months - |11:100| - to your needs.

13 years ago | 1

| accepted

Answered
Log likelihood
You can try the following submission: http://www.mathworks.co.uk/matlabcentral/fileexchange/34943-fit-all-valid-parametric-proba...

13 years ago | 0

Answered
Changing Plot and Label font
Suppose you have the following example: x = -pi:.1:pi; y = sin(x); plot(x,y) lx = xlabel('x'); ly = xlabel('y...

13 years ago | 0

| accepted

Answered
Efficiently convert cell to double
To address the OP comments: Suppose you have this fake input (6000 by 1 cell array where each cell is a 1 by 3 cellstring): ...

13 years ago | 0

Answered
clear from Command window
You can erase what has been printed in the command window with <http://www.mathworks.co.uk/help/techdoc/ref/clc.html |clc|> T...

13 years ago | 0

| accepted

Answered
ommiting blanks in code
Use <http://www.mathworks.co.uk/help/techdoc/ref/strtrim.html |strtrim()|> Example: str = ' some blanks here and there ...

13 years ago | 1

Answered
ASCII file
a = rand(10,2) save('mydata.asc','a','-ascii')

13 years ago | 0

Answered
choose string variables using ismember
setdiff(A,'0')

13 years ago | 0

| accepted

Answered
Associating csv data with matrix & Matrix creation for Day of Year / time
# Import the whole data (all rows and the 4 columns) with <http://www.mathworks.co.uk/help/techdoc/ref/fopen.html |fopen()|>, <h...

13 years ago | 1

| accepted

Answered
importing dates into excel
Use |cellstr()| cellstr(datestr(datenum({'02/11/08'},'dd/mm/yy')+(0:28:38*28),'dd/mm/yy'))

13 years ago | 1

| accepted

Answered
Decimal
This is a user defined function available on the FEX: <http://www.mathworks.com/matlabcentral/fileexchange/24213 |round2dp|>. ...

13 years ago | 1

| accepted

Answered
repeating elements of a vector
Fully vectorized run-length decoding: % Example inputs (as vector columns) lambda = [2; 4;9]; ng = [3;4;7]; % P...

13 years ago | 1

| accepted

Answered
why is my plot not showing anything
You are overwriting |f| at every iteration and in the end you just have one point. plot(r,f) will plot thus one point. I...

13 years ago | 5

| accepted

Answered
store the output of a for loop in an array
I did not preallocate (up to you) F = @(x) (cos(x))./sqrt(1+sin(x)); n = 0:0.1:pi/2; for ii = 1:numel(n) q(ii)...

13 years ago | 0

Answered
How to create an array like this? with dot after the number
You can create such an array just as a string: sprintf('%.f. ',ones(10,1))

13 years ago | 0

| accepted

Answered
Problems with symbolic representation
a = 5; b = 7; c = a+b; syms x out = solve(x/2*a-7*b-13*c+14*a*b*x*c-34*x-7*b,x) double(out) Note that I did ...

13 years ago | 1

| accepted

Answered
Random number in a specific range
You can scroll down the documentation of |randn| for an example. *EDIT* You don't even need to scroll down.

13 years ago | 0

Answered
selecting specifi sequence of cells from a matrix
You might want to consider a relational database management system (RDBMS) such as *mySQL*. There is a little bit of learning cu...

13 years ago | 1

| accepted

Answered
How to label the secondary axis of a graph
The 4th syntax of <http://www.mathworks.co.uk/help/techdoc/ref/ylabel.html |ylabel|> shows explixitly than you can 'refer' to a ...

13 years ago | 0

| accepted

Answered
Fitting a Skewed Gamma Probability Distribution Function to Data, or fitting any skewed pdf to data.
params = gamfit(rand) returns the shape and the scale parameters of a Gamma distribution: <http://en.wikipedia.org/wiki/Gam...

13 years ago | 1

Answered
vector
Manually: X(2:end)./X(1:end-1)

13 years ago | 0

Answered
function parameter - char
Check that the function is on the MATLAB path with: which -all Amplitude_lie_det If it says |'Amplitude_lie_det' not fou...

13 years ago | 0

Answered
How to remove decimal??
To make it clear: a = 2.00000000001 a = 2.0000 Displaying the integer part ( |ans| is a char), but |a| retains...

13 years ago | 2

| accepted

Answered
How do I read in specific parts of a binary file?
Use <http://www.mathworks.co.uk/help/techdoc/ref/fseek.html |fseek|> and then |fread|.

13 years ago | 1

| accepted

Answered
Help with 'fminsearch'
P = fminsearch(errfh,p0,optimset('MaxFunEvals',1000),t,rel) Check the documentation for <http://www.mathworks.co.uk/help/te...

13 years ago | 0

Answered
Deleting rows in Matlab
*EDITED* idx = idx = col1(:,1) < 600 & col1(:,1) ~= 0; col2 = col1(idx, 1);

13 years ago | 0

Answered
Symbolic calculation
You are comparing eigenvectors, which need not be unique. Comparing eigenvalues: rhs = matlabFunction(e); rhs(1,2,3) ...

13 years ago | 0

| accepted

Answered
one column of data manipulating the other.
c1 = [ 1 3 5 9 13]; c2 = [34 65 79 134]; bsxfun(@minus, c1,c2')

13 years ago | 1

| accepted

Answered
for loop problem
sel = [10 11 22 53:55]; for i = 1:6 Data = importdata(sprintf('xxxx', sel(i))); subplot(3,2,i) plot(D...

13 years ago | 0

Load more