Answered
how to create a mat file
help save Example var1=[1 1 1] var2=[2 2 2] save filename var1 var2 %or var=[var1;var2] save fimename var

14 years ago | 1

| accepted

Answered
Decrementing for loop in MATLAB
for k=5:-1:1 %do end

14 years ago | 13

| accepted

Answered
How can I assign values to an equation?
From your question I guess you are using discrete function, g=[ones(1,11) 1.2 1.6 1.12] Because Matlab don't allow neg...

14 years ago | 0

| accepted

Answered
can i give variable different names then call this name
You can also generate names depending on your counter for k=1:3 name{k}=sprintf('name%d',k) end

14 years ago | 1

Answered
How to put Delay in simulink blocks
If you are runing your simulink model in a normal mode, the execution will be done almost instantly, you need to run your model ...

14 years ago | 0

| accepted

Answered
How do I take spaces out of a string array with multiple rows?
s='1 0 1 0 ' s(strfind(s,' '))=[] for multiple rows b(1,:) = '1 0 0 1' b(2,:) = '0 1 1 0' idx=strfind(b(1,:),' ') ...

14 years ago | 1

| accepted

Answered
How can I change axes labels?
yt=get(gca,'ytick'); set(gca,'yticklabel',fliplr(yt))

14 years ago | 0

Answered
Simple question about vector remainders
y=(x-20).*(x>20)

14 years ago | 1

Answered
plotting a polynomial problem
use operations element by element .^ x=0:0.01:1 u=a*x+b*x.^2+c*x.^3+d*x.^4 because x is a vector, to compute x^2,...

14 years ago | 0

Answered
User inputed vector - Index exceeds matrix dimensions.
Because when |cnt==6|; you can't calculate |e = e(1:cnt)|; |(numel(e)=5)|

14 years ago | 0

Answered
Differential equations on MATLAB
function dx=my_eq1(t,x) dx=zeros(4,1); A =[5 1 0 0; 1 5 0 0; 0 0 1 -2; 0 0 2 1] dx=A*x %call your function xiniti...

14 years ago | 0

Answered
surfs and meshplot problem
plot3(Z,M,eps)

14 years ago | 0

Answered
Sum of previous elements in a matrix(dynamic way)
A=[1 2 3; 4 5 6;7 8 9;10 11 12]; out=A(1:end-1,:)+A(2:end,:)

14 years ago | 0

Answered
Create a structure from discrete column vectors or a 3 x n matrix composed of column vectors
y=[3.7427 3.74984 1.38903 4.7384 3.76483 8.76289 9.6389 9.62843 5.78290] for k=1:size(y,2) ve...

14 years ago | 0

| accepted

Answered
FIGURE: plot monthly data and only present the years
try this dt=datenum(2002,(1:120),1)

14 years ago | 2

| accepted

Answered
what does sin(pi*[-Fs:1/Fs:Fs] )mean?
v=[-Fs:1/Fs:Fs] %is a vector with element from -Fs to Fs with step = 1/Fs

14 years ago | 0

Answered
turn 0 to 0.000
use fprintf a=0; fprintf('%5.3f\n',a)

14 years ago | 0

Answered
Need syntax help for creating loop that is dependent on array size
s=size(A); if all(s==[2 2]) %do elseif all(s==[3 3]) disp('System not designed to evaluate 3x3 matrices') else ...

14 years ago | 0

| accepted

Answered
Matlab type mismatch in Embedded Matlab Functions
Embedded Matlab function don't allow |dec2bin| function. You must fix the first problem then look after the second. Maybe the se...

14 years ago | 0

Answered
no of bits increases after decimal to binary conversion
2^4+5 requires at least 5 bits If you want to represent *a* with 4 bits b=dec2bin(a,4) also, to use *dec2bin(a)*,...

14 years ago | 0

Answered
How should be change ROOT LOCUS asymmetric?
k=-1000:0.1:1000; rlocus(Hs,k)

14 years ago | 0

| accepted

Answered
Plotting root locus with variables in transfer function
If |G(p)| is your system transfer function, The transfer function of your system in a closed loop with gain *k* is |Gc(p)=G(p)/...

14 years ago | 2

| accepted

Answered
Relational operations problems (real and imag parts)
Maybe it's about numerical problems, for example try this 0.3-0.2==0.4-0.3 %you will find 0

14 years ago | 0

Answered
finding time of damping graph
t=0:0.1:10; y=sin(t); idx=find(y==0) % If y is exactly equal to 0

14 years ago | 0

Answered
when i have two plots on same figure, how can i clear only one plot ??
%Look at this example t=0:0.1:10; y1=sin(t) y2=cos(t)*10 % plot your first data plot(t,y1,'r') ax1=gca pos=double(...

14 years ago | 0

Answered
how to generate a polynomial
s=[2 3 ;4 5] text = [2 3 4; 5 6 7; 4 5 6] t=text.' t=t(:) th=3; x=11 [n,m]=size(s) c=1:th-1; idx1=1; idx2=th-1; for...

14 years ago | 1

| accepted

Answered
Is it possible to obtain a random sample of values from a matrix without the randsample tool?
A=magic(6); out=A(randi(numel(A),1)) if you want 3 values for example out=A(randi(numel(A),3,1))

14 years ago | 0

| accepted

Answered
how to generate a polynomial
s=[2 3 ;4 5] text = [3 5 6 7 3 4 5 6] threshold=4; x=11 c=1:threshold-1 P=s(1,1)+sum(text(c).*x.^c)

14 years ago | 0

Answered
How can I sort data like this?
try this B=A while length(A)>0; idx=find(A==conjug(A(1))); B(ii)=A(1); B(ii+1)=A(idx); A(idx)=[]; ...

14 years ago | 0

Load more