Answered
How to change the axis limits?
ylim([-14 4]*1e-4)

12 years ago | 0

Answered
Undefined function 'rr' for input arguments of type 'double'.
What is rr? make sure that rr.m is in your current folder

12 years ago | 0

Answered
multiple y axes, one x axis
*Edit* x=0:0.5:10; y1=0.1*sin(0.1*x); y2=0.1*cos(0.1*x); y3=0.1*cos(0.2*x); %------------------------------------------...

12 years ago | 1

| accepted

Answered
Multi dimensional array scaling
[n,m,p]=size(A) out=5*reshape(repmat(1:p,n*m,1),size(A)).*A

12 years ago | 0

| accepted

Answered
How can a run my script 100 times and gain the results at once??
for i=1:100 output{i}= myScript(input); end

12 years ago | 0

| accepted

Answered
Have x find y
x=0:0.1:10; y1=cos(x); y2=sin(x); x1=2.234 y11=interp1(x,y1,x1) Y21=interp1(x,y2,x1)

12 years ago | 0

| accepted

Answered
Better syntax than for loop
VKT_SC=bsxfun(@times,SC_Share,Total_F_VKT) or depending on the size of Total_F_VKT VKT_SC=bsxfun(@times,SC_Share,T...

12 years ago | 0

| accepted

Answered
Not expected results using datevec funcion
Use this result = datevec(datestr('13/12/2013', 'dd/mm/yyyy HH:MM:SS')) |datestr| will set the missed time to 00:00:00 ...

12 years ago | 1

| accepted

Answered
image() function is overwriting old image?
Use imshow(im1) figure imshow(im2)

12 years ago | 1

Answered
Sort cell array according to the max value in the second row
row1= {1, 2, 3} row2 = {20, 180,500} a=sortrows([row1' row2'],2); out=flipud(a(:,1)) %or [idx,idx]= sort(cell2mat(r...

12 years ago | 0

| accepted

Answered
Sum the digits of a number?
a=525; b=num2str(a); while numel(b)>1 a=sum(str2double(regexp(b,'\d','match'))); b=num2str(a); end out=str2num(b) ...

12 years ago | 2

Answered
Plot a vector as a row of grayscale squares
N=10; x=rand(1,N) for k=1:N x0=k; y0=0; x1=x0+1; y1=1; rectangle('Position',[x0 y0 x1 y1],'FaceColo...

12 years ago | 0

Answered
finding simultaneously maximum values of three vectors (optimal point)
Define a criterion J=w1*A+w2*B+w3*C out=max(J) % w1, w2 and w3 are chosen to make your three signals closer.

12 years ago | 1

Answered
Displaying three set of plots in one figure
%look at this example x=0:0.1:10; y1=sin(x); y2=cos(x); y3=2*abs(cos(x)); plot(x,y1,'r',x,y2,'g',x,y3,'b') %Then add w...

12 years ago | 1

| accepted

Answered
Matlab help window doesn't allow copy
<http://www.mathworks.com/matlabcentral/answers/104025-why-is-the-formatting-of-my-matlab-documentation-broken>

12 years ago | 0

Answered
Syntax error in Simulink
You have a problem with brackets (u(2)*u(3)^2)/12-((u(2)*u(3))^2)/8*(1-2*u(1)/u(3))-(1/3)*(1-2*u(1)/u(3))^3

12 years ago | 1

| accepted

Answered
How can I rearrange all row elements into a single row?
b=[0 0 1 1;1 1 1 0; 1 1 0 0;0 0 0 0] b=b(:)' %or maybe you want b=[0 0 1 1;1 1 1 0; 1 1 0 0;0 0 0 0] b=b' b=b(:)'...

12 years ago | 1

| accepted

Answered
Find rows containing N zeros in a matrix
mat(sum(mat==0,2)==2,:) For general case N=2 out=mat(sum(mat==0,2)==N,:)

12 years ago | 0

| accepted

Answered
Peak finder - finding major peaks instead of just the smaller ones
minimum_peak=10 % For example [pks,locs]=findpeaks(your_signal,'MINPEAKHEIGHT',minimum_peak)

12 years ago | 0

Answered
Plotting within a for loop
for n=1:bazillion plot(Data(:,n)); hgsave(gcf,sprintf('figure%d.fig',n)) end Then use hgload to get your plo...

12 years ago | 0

Answered
matlab recognise french character
If I write s='Hétérogénéité' The result is s= Hétérogénéité You can't use Hétérogénéité as a variable, but ...

12 years ago | 0

Answered
please identify my mistake
* instead of . d2(l1,:)=c4*m1*a(1,2)^(j-1)

12 years ago | 0

Answered
how to filter files in matlab
files={'SAMPLE_20120807_1816.TXT' 'SAMPLE_20120807_1916.TXT' 'SAMPLE_20121207_1311.TXT' 'SAMPLE_20121307_1816.TXT' 'SAM...

12 years ago | 0

| accepted

Answered
solving transcendental equation numerically
M=sym('M',[1,5]) A=sym('A',[1 5]) PBAR = 0; L = [0.1,0.5,1.0,1.5,2.0]; equation1 = A.^3 - L.*A^.2.*(sqrt(M.^2-1) + M.^2.*a...

12 years ago | 0

Answered
how to split value in a cell
v={'SAMPLE20130101_1101.txt' 'SAMPLE20130101_1101.txt' 'SAMPLE20130101_1101.txt'} out=strrep(v,'.txt','')

12 years ago | 0

| accepted

Answered
How to assign the value of a symbolic varible in a cell to other variable
str2double(regexp(char(solution{1}),'[.\d]+','match'))

12 years ago | 0

| accepted

Answered
Using a function strncmp
out=[]; fid=fopen('asdf1.txt'); tline=fgetl(fid); while ischar(tline) if ~strncmp(tline,'#',1); out{end+1}=...

12 years ago | 0

| accepted

Answered
Problem for creating matrix with loop
What is the purpose of creating other variables, when you can access any part of your matrix, whenever you want. If you want...

12 years ago | 0

Answered
How to Create an executable file for Simulink model?
You can generate a c code for your simulink model, but you will need a simulink coder

12 years ago | 0

Answered
How to compare two rows in a cell {n x 1}
a={11 2 0 5 2 8 8 1}' b={1 25 3 6 0 3 12 2}' s=sign([a{:}]-[b{:}])% if s=-1, a<b, if s=1, a>b, if s=0, a=b

12 years ago | 0

Load more