Answered
Most efficient way for multiple dlmread executions
for k=1:n data{k}=dlmread(sprintf('syyr%d_1.his',k),",4,1); end There is no need to use multiple variables, a cell varia...

14 years ago | 1

Answered
Using embedded function in Simulink
Pat, that's what I was expecting, the size of y is |[1 303]|, that means your output will be a vector of 303 elements which will...

14 years ago | 0

| accepted

Answered
Running m file from simulink
You can use callback in simulink, fellow thhese steps # right click on your simulink model # click on model properties # c...

14 years ago | 4

| accepted

Answered
Output of a vector which excludes the entries of the second vector
p = [1 2 3 4 5 6 7 8], q = [2 5 7 9], out=p(~ismember(p,q))

14 years ago | 0

| accepted

Answered
Help with a ode45 problem
The error is in theta(0)=[10:30:130]*pi/180; do you mean theta0=

14 years ago | 1

| accepted

Answered
Unexpected result for sin()
f=50; np=5 % number of period t1=np/f % final time ns=20 % number of sample per period ts=1/(ns*f) % ...

14 years ago | 0

Answered
Output of the row of a vector which has the same entry as a second vector
a=[1 3 5 8 9 10 13 16]'; b=[2 5 1 1 8 8 8]'; un=ones(numel(b),1) out=cell2mat(arrayfun(@(x) un(b==a(x))*x,(1:numel(a))','un...

14 years ago | 0

Answered
what function is used to make this condition??
a=386504398760 b=num2str(a) out=str2num(b(2:3))

14 years ago | 0

Answered
question about Simulation annotations
The values in base workspace can be used in simulink model, it does 'nt depend on annotations, you can use click function in ann...

14 years ago | 0

| accepted

Answered
How to reverse a number
a=8549 out=str2num(fliplr(num2str(a)))

14 years ago | 6

Answered
How to graphing a 3D surface when the X,Y,Z are known
t=[5,10,15] T=[30,40,50] [tt,TT]=meshgrid(t,T); y=sin(tt).*cos(2*TT); mesh(tt,TT,y)

14 years ago | 0

Answered
How to solve a system of equations symbolically? (MATLAB R2011a)
syms x1 x2 x3 X1 X2 X3 t S = solve(x1==3*t*X1+X2, x2==2*t^2*X2, x3==5*t*X3,X1,X2,X3) S = [S.X1 S.X2 S.X3]

14 years ago | 1

Answered
How to make a simple plot (loading many files)?
f=struct2cell(dir('yourfolder/*.dat')); name=f(1,:) figure; hold on for k=1:numel(name) v=dlmread(name{k}); plot...

14 years ago | 1

| accepted

Answered
How to make this a real number
x=1.3357e+03; out=sprintf('%.1f',x)

14 years ago | 0

| accepted

Answered
Generating a "special" probability random matrix in efficient way
try this n=10,m=12; x=rand(n,m)/m; [~,id1]=max(x'); id2=m+1-id1; for k=1:n x(k,id1(k))=0.5; x(k,id2(k))=1-sum...

14 years ago | 0

Answered
non linear differential equation
function dq=myeq(t,q,t1,u1,a1,b1) u=interp1(t1,u1,t) dq=-q+a1+b1+1/u^2; %Then call myeq a1=1; b1=2; q0=0; t1=1:0....

14 years ago | 0

Question


How can i save my matlab shortcuts?
how can i save my Matlab shortcuts for use with another Matlab.

14 years ago | 2 answers | 3

2

answers

Answered
Using Find() in For Loop
xn=[1 0 16 14 18;0 13 4 0 11; 0 4 15 1 52; 0 5 5 17 43; 0 11 5 3 14]; y=[1 24 35 15 16]; %Threshold [n,m]=size(xn); SD=1.5; ...

14 years ago | 0

Answered
How to export date from an array to excel file?
s=cellstr(date) save('file.xls',s)

14 years ago | 0

Answered
how to create a mat file
Im1=imread('image1.jpg'); Im2=imread('image1.jpg'); save filename Im1 Im2 %to call your images load filename imsho...

14 years ago | 0

Answered
Why can't i use "from file" block in simulink
The problem is how you saved your data. Example t=0:0.1:10; % vector time y=sin(t) % t and y are line vectors ty=[t;y]...

14 years ago | 1

Answered
Discrete sampling on continuous-time model
Have you tried to set the sample time of your Gain2 block?

14 years ago | 0

Answered
Matrix and vector multiplication elementwise
a=[1 2 3;2 3 4;4 5 6] h=[2 2 2] out=cell2amt(arrayfun(@(x) x*h,a(:),'uni',0))

14 years ago | 0

Answered
How to work with fcn block in simulink
To generate u, use a source *repeating sequence stair* block, then connect it to *sine wave function* block from *simulink/math...

14 years ago | 0

| accepted

Answered
How can I edit the Simulink To Workspace block from a .m file?
set_param('Filename/ToWorksapce','MaxDataPoints','100') If you want to get your block parameters names get_param('File...

14 years ago | 0

| accepted

Answered
Discrete system solving with MATLAB
you will need initials condition y(0) and y(-1); because Matlab don't allow negative index we 'll consider y(2) and y(1) as init...

14 years ago | 1

| accepted

Answered
Converting 4 bits to 5 bits
use a1 = dec2bin(mod(2^5+a,2^5),5)

14 years ago | 1

| accepted

Answered
Sorting values according to index
S=[70 110 65 30 25 40 60] K=[4 2 3 1 5 7 6]; [~,idx]=sort(K); out=S(idx)

14 years ago | 1

| accepted

Load more