Answered
How can I go from a transfer function to a inverse Laplace transform?
syms s h=ilaplace(2/(s^2+2*s))

12 years ago | 0

Answered
How to print the element of a cell into a text file?
If A is your cell array M=cell2mat(cellfun(@(x) cell2mat(x),A','un',0)) dlmwrite('file.txt',M)

12 years ago | 0

| accepted

Answered
How to use the prod function on non-zero elements?
A = [0 1 2; 2 0 4; 7 8 0]; B=A B(~A)=1 % replace 0 elements by 1 out=prod(B,2)

12 years ago | 0

| accepted

Answered
Ploting a graph on two x-axis and two y-axis
Look at this example x1=0:0.1:10; x2=5:0.1:45; y1=cos(x1); y2=5*sin(x2); [ax,h1,h2]=plotyy(x1,y1,x2,y2) set(ax(2),'XAx...

12 years ago | 1

Answered
Block in Simulink to indicate on-off state of a valve
If a valve is open or closed under a certain value of a pressure, you can use <http://www.mathworks.com/help/simulink/slref/comp...

12 years ago | 0

Answered
How can i retrieve variables created in a function?
Call your function: [x,z]=panelgen(airf,N,AoA)

12 years ago | 1

| accepted

Answered
how to repeat a section of code changing file parameters
for k=1:10 file=sprintf('Image_%d.jpg',k) %do end

12 years ago | 1

Answered
plot two vectors simultaneuosly on the same axis?
a=[2 4 3 6 7 8] b=[7 5 2 4 4 1] x=[a ;b] x=x(:) y=[zeros(size(a)); ones(size(b))] y=y(:) plot(x,y)

12 years ago | 1

| accepted

Answered
if loop not working..please help.
Replace the If/else by e1=ones(size(s)) idx1=s>i; e1(idx1)=s(idx1)/4 idx2=s==i; e1(idx2)=(s(idx2)+2)/4 x1=e1

12 years ago | 0

| accepted

Answered
how to use a uitable to add two numbers
figure('position',[100 100 400 150]) a=1; b=2; c=a+b; data={a b c}; headers={'a','b','c=a+b'}; h = uitable('Data',data, ...

12 years ago | 0

Answered
converting decimal matrix to binary matrix
M = [ 1 25 34 9 ] out=cellstr(dec2bin(M,8))'

12 years ago | 1

| accepted

Answered
Matlab - Simulink: Automatically changing block variables and collecting data from a model
You can change your block parameters by <http://www.mathworks.com/help/simulink/slref/set_param.html set_param> command <http...

12 years ago | 0

Answered
How to get the correct asin value
You can't get -3*pi/2, you have to add k*2*pi, in your case asin(sin(-3*pi/2))-2*pi

12 years ago | 0

Answered
convert an ant2 angle in degrees
If x is in radian Y=x*180/pi

12 years ago | 0

| accepted

Answered
limiting range of row in matrix
score(1:50,:)

12 years ago | 0

| accepted

Answered
Please help write a script to display the first line of this text file using fgetl
fid=fopen('yourfile.txt') line=fgetl(fid) fclose(fid)

12 years ago | 0

| accepted

Answered
Continue entering statement in command window.... No o/p
You probably forgot a bracket ]

12 years ago | 0

Answered
Restore "change folder" dialog box
Run this code f='E:\matlab' % for example, your desired folder cd(f)

12 years ago | 0

Answered
How to read numeric data from text file and plot graph for given numeric data?
fid=fopen('file.txt') s=textscan(fid,'%d %d %d','headerlines',23) fclose(fid) x=s{1} y=s{2} z=s{3}

12 years ago | 0

| accepted

Answered
What is the log scale base that is used by Matlab during plot?
log10(x)

12 years ago | 0

| accepted

Answered
How to create mean matrix in multi-dimensional array
a=rand(8,8,40) %example a1=a(:,:,1:20); a2=a(:,:,21:end) m1=mean(a1,3) m2=mean(a2,3)

12 years ago | 0

| accepted

Answered
Removing a column from multidimensional array
a=a(:,1:5,:)

12 years ago | 0

| accepted

Answered
Assigning value to an array
A=[0 0 0 0 0 0 0 0 0 0 0 0]; A([1 2 11 12])=30 A([2 10 12])=A([2 10 12])+20

12 years ago | 1

| accepted

Answered
How to find the difference between 2 consecutive rows of a matrix?
diff(A)

12 years ago | 5

| accepted

Answered
How to change the value of a double variable in a .mat file
If your file is not big, just load your data, modify them, then save again your data %Look at this example a.b1=1; a.b2=2;...

12 years ago | 0

| accepted

Answered
how to convert w=M(e^jπ) into complex number
%example 10*exp(j*5) This already a complex number

12 years ago | 0

Answered
how to plot a graph of the equation (x^5)+(x^4)+(x^3)+(9*x^2)+8*x+3
coeff=[1 1 1 9 8 3] % the coefficients of your polynomial x=-8:0.1:6 y=polyval(coeff,x) plot(x,y,'r')

12 years ago | 1

Answered
How can I find the first row of a specific number in a matrix?
idx=find(any(A==6,2),1)

12 years ago | 1

| accepted

Answered
save data after each loop in next row of xlsx file
You can save your data in a Matrix M, then aftr the loop, save the matrix in your Excell file xlswrite('file.xlsx',M)

12 years ago | 0

Answered
How to split an array
a= [1 2 3 4 6 7 8 10 11 12] s=[[2 diff(a)]==1 0] out=arrayfun(@(x,y) a(x:y),strfind(s,[0 1]),strfind(s,[1,0]),'un',0); ...

12 years ago | 0

Load more