Answered
2nd order systems of differential equation
By adding 3 variables y4,y5 and y6 your system becomes a first order differential equations system. %y4=dy1/dt, thus d2...

13 years ago | 2

| accepted

Answered
Basic question again : How plot a finite length rectangular pulse
n=2:4; y=ones(1,numel(n)) stem(n,y)

13 years ago | 1

| accepted

Answered
how do i get matlab to plot on different graphs?
plot(subs(x),subs(y))

13 years ago | 0

Answered
Scaling up a default output range between 0 & 1 to a different output range in Matlab
v=100:0.1:150 % your signal min1=10 max1=20 out = min1 + (max1-min1)*(v-min(v))/(max(v)-min(v));

13 years ago | 0

Answered
indent multiple matlab codes
Use fgetl function to read your files and save them in a cell array. Concatenate your variables then save the result in one file...

13 years ago | 0

Answered
find & replace data in array
A=[7 14 21 28 35 42 49 56 63 70 77 84 91] B=[22 55] for k=1:numel(B) [ii,ii]=min(abs(A-B(k))); A(ii)=B(k); end

13 years ago | 0

Answered
How to compute and plot a Spectrogram?
Look at help load help plot

13 years ago | 0

Answered
A very basic question about plotting a signal in the time domain
tSampling=1/Fs; n=numel(signal); t=-0.005:tSampling:-0.005+(n-1)*tSampling; plot(t,signal); %or t=linspace(-0.005,0...

13 years ago | 2

| accepted

Answered
Plot a sine function
t=0:0.01:2; y = sin(2*pi*t).*sin(2*pi*20*t); plot(t,y)

13 years ago | 0

Answered
How can i mutiply variable in simulink
Use a <http://www.mathworks.com/help/simulink/slref/clock.html clock> block to get the time t

13 years ago | 0

Answered
How can i calculate the largest interval when the elements of an array are larger than a value?
a=[ 0 6 5 2 16 17 16 11 12 14 5 6 9 16 17 18 18 16 17 18 19 20 16 17 9]; b=a>15; id= [0 diff(b) 0]; id1=find(id==1); id2...

13 years ago | 0

Answered
Help me with the simulink.
it's the same thing with one equation, just use derivative, sum and gain block.

13 years ago | 1

Answered
i have a binary data how can i plot the square wave for the binar data in matlab?
%----------------your signal y - and time x------------- n=10 y=repmat([1 0],1,n) y=y(:) x=1:n %--------------sawtooth---...

13 years ago | 1

Answered
Excel data to matlab
[v,T,vT] = xlsread('filename1.xlsx') temps=cell2mat(vT(:,1)) % time temps=datestr(temps,'HH:MM:SS') valeur=cell2mat(...

13 years ago | 2

| accepted

Answered
calculate differences inside columms between absolute and dinamic references inside of Matrix. Saving results.
A=[306 305.952 304.683 302.265 300.219 306 306.008 304.977 302.45 299.846 306 305.962 304.84 302.413 299.812 ...

13 years ago | 0

| accepted

Answered
Making a Loop with Strings
Use a cell array x = [2 5 9 11 14 16 17 18 20 22 23 24 28 29]; for i =1:14; data_10_100{i} = importdata(sprintf...

13 years ago | 2

| accepted

Answered
How to detect, open and process nxm matrices?
If your files are not big, you can use v=dlmread('file.txt')

13 years ago | 0

Answered
How to create variables using strings in an array?
What you are doing is not recommanded <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_...

13 years ago | 1

| accepted

Answered
How to properly excite state-space models with time-delay using step-function?
Now I get it, your C PID should be in series with your model G and the feedback is the constant 1 sys=feedback(G*C,1) step...

13 years ago | 0

| accepted

Answered
How to properly excite state-space models with time-delay using step-function?
% I do not know how feedback function works. I can create feedback by connecting my models and signals use <http://www.mathwo...

13 years ago | 0

Answered
how to generate binary matrix with all combination having equal probability of 1 and 0 ?
This is not the more efficient way a=[1 1 1 1 0 0 0 0]; b=unique(perms(a),'rows'); out=b(sum(b,2)==4,:)

13 years ago | 1

Answered
help: efficiently pass a lot of variables to a function
put all your variables in a cell array. For example Your_array={var1,var2,var3} Then you can use one variable as input a...

13 years ago | 1

Answered
Help: numerical solution for first order differential (OD) equations
A should be a 9x9 array write and save this function as myeq.m function dY=myeq(t,Y) A=randi(9,9,9) ; % Example b=1;...

13 years ago | 0

Answered
how i can limit the resistance(R) value within 1000 and 2000 ?
Change the line R = input('please Enter the value for resistance:'); by R=0 while R<=1000 | R>=2000 R = input...

13 years ago | 0

| accepted

Answered
How to substitute a function after differentiation?
I think you can not make substitution, because the derivative is not yet calculated. what you have to do is syms x y; f=y/...

13 years ago | 0

Answered
LQR Simulink block model
There is no such block, but you can call the <http://www.mathworks.com/help/control/ref/lqr.html LQR function> from simulink by ...

13 years ago | 1

Answered
removing repeated values from an array
Y=[1.2 8 89 1.2 4 8 32 1.2] unique(Y) % The result is sorted %or unique(Y,'stable') % the result is not sorted

13 years ago | 0

| accepted

Answered
Distance between elements of matrix
n=numel(A) B=-diff(A(fullfact([n n]))')'

13 years ago | 0

Answered
maximum value in a 3d matrix
for k=1:size(A,3) a=A(:,:,k); [maxv,idx]=max(a(:)); [ii,jj]=ind2sub([size(A,1) size(A,2)],idx); out{k}...

13 years ago | 1

| accepted

Answered
how to create a specific matrix from an array
A=[1 2 3 4 5 6 7] m=5; n=numel(A); id=bsxfun(@plus,repmat(1:n,3,1),(0:2)'); id=id(:,1:m); B=A(id)

13 years ago | 0

| accepted

Load more