Answered
How to save a figure (subplot) through each run of a for loop
Use the command "figure" to create a new figure

10 years ago | 0

Answered
How can I export a matrix as a CSV file?
a=[234,2 671,5 735,1] csvwrite('file.csv',a)

10 years ago | 7

Answered
how to convert matrix to binary matrix?
A_C=~~A Or A_C=logical(A)

10 years ago | 0

| accepted

Answered
How to intialize a data store with 100000 zeros?
zeros(1,100000)

10 years ago | 0

| accepted

Answered
Dividing an interval into smaller intervals and name them.
a=1:100 b=mat2cell(a,1,10*ones(1,10)) you have a cell array containing ten intervals b{1} b{2} ... and so on Gi...

10 years ago | 0

Answered
Find X from Y in a graph
Try x = interp1(x_values,y_values, -3.951,'linear','extrap');

10 years ago | 0

| accepted

Answered
how to find n values that are closest to zero
Look at this example: A is a matrix 5x5 and n=2 A=rand(5)-0.5 n=2 [~,idx]=sort(abs(A(:))) B=A(idx) [ii,jj]=ind2sub(size...

10 years ago | 0

| accepted

Answered
i want to convert from direct to parallel form, and i am getting an error massage???
Download the function dir2par from here <http://www.mathworks.com/matlabcentral/answers/?sort=asked+desc>

10 years ago | 0

| accepted

Answered
can someone tell me whats wrong with my code
if (x(i+1) - x(i))= 2 is an error, use: if x(i+1) - x(i)== 2 Also, use only the while loop

10 years ago | 0

Answered
running m-file from Simulink
Use model callback <http://www.mathworks.com/help/simulink/ug/model-callbacks.html>

10 years ago | 0

Answered
close figure and stop loop
break will not close a figure, use close(1)

10 years ago | 0

Answered
Transform a polynomial in syms to [1,2,3,4,5] and back to syms
y=poly2sym([1,2,3,4,5] ) sym2poly(y)

10 years ago | 0

Answered
if i have three matrix i want to return some one according to vaue
S1 = [ 1 0 0 1 1 1 1 0 0 1 0 1 ] S2 = [ 1 1 0 1 0 1 0 1 1 1 0 0] S3 = [ 1 1 1 1 ...

10 years ago | 0

Answered
Using variable value to name a folder
Name=4205; writetable(T,sprintf('%d.csv',Name));

10 years ago | 1

| accepted

Answered
Error using ==> mtimes Inner matrix dimensions must agree.
Use ./ instead of / y=(4*1i*(W*cos(W) + sin(W)))./(W^2);

10 years ago | 1

| accepted

Answered
Multiply each number in a matrix by the diagonal number of a given row using a for loop
a=[2 -5 7;1 1 3;4 5 12]; b=bsxfun(@times,a,diag(a))

10 years ago | 0

Answered
Find the sum of the non perimeter elements of a matrix using a for loop
A=B A(:,[1 end])=0 A([1 end],:)=0 out=sum(A(:))

10 years ago | 0

Answered
(Matlab 2013) Specify Number of Decimal Digits When Reading In a Number
a=fscanf(fid,'%f',1) sprintf('%0.6f',a) Or use format long

10 years ago | 0

Answered
How can i create a matrix from time series data?
If M is your time series V=M.Data

10 years ago | 34

Answered
Restructure matrix to get back original matrix
B=reshape(temp,c,r)'

10 years ago | 1

| accepted

Answered
Plotting 3D graph
plot3(z,y,x)

10 years ago | 0

Answered
How do I create a time stamp with 5 minutes interval?
A(1:5:end) B(1:5:end)

10 years ago | 0

| accepted

Answered
how to count the number of zeros between 2 one's
nu=~num; s=cumsum(num)+~num(1); ii=strfind(num,[1 0]); jj=zeros(size(num)); jj(ii)=1; s=s+cumsum(jj) f=accumarray(s',(1:...

10 years ago | 1

Answered
All result is zero !
Use Xmn = double(input(i,j))

10 years ago | 0

| accepted

Answered
Creating matrix from other matrix columns with loop?
You don't need a loop out=y idx=[3 4 5 10 12 14 16] out(:,idx)=x

10 years ago | 0

| accepted

Answered
trying to plot a more complicated step function
ts=0.01 t1=0:ts:1.25-ts t2=1.25:ts:2.5-ts t3=2.5:ts:7.5 t=[t1 t2 t3] y=[t1*0 -0.18*ones(size(t2)) 0*t3] plot(t,y) or ...

10 years ago | 0

Answered
How can I change this to give me [4x5 double] arrays in the cell array?
If you want a 5x4 cell array, use C{m,n} instead of C{n,m} for n = 1:L for m = 1:W C{m,n} = size(A); end end

10 years ago | 0

Answered
How can i make the sum of matrix elements>0 under the condition that there are min 3 zeros between the sums?
a=[2 3 0 0 4; 0 0 0 0 0; 0 5 3 0 4; 14 4 0 1 1; 0 0 0 0 0; 0 0 0 7 9; 0 0 0 0 0; 0 0 0 0 0; 9 6 0 0 1; 1 1 1 0 0] b=reshape(a...

10 years ago | 0

| accepted

Answered
How can I find poles and zeros of transfer function matrix ?
Use roots function

10 years ago | 1

Load more