Answered
how to include my own matlab functions in simulink
Use <http://www.mathworks.com/help/simulink/slref/interpretedmatlabfunction.html Interpreted Matlab Function>

12 years ago | 0

Answered
why trigonometry input in degrees gives wrong results
If a is in degree you need to use another function sind(3) Also, when you say a is in degree, you know this, but how th...

12 years ago | 1

| accepted

Answered
hello, is it possible to get matlab code (.m) from simulink blocks (.slx)?
Look at this <http://www.mathworks.com/matlabcentral/answers/24682-matlab-code-corrsponding-to-simulink-block answer>

12 years ago | 0

| accepted

Answered
Set a global variable in a script with multiple functions
You can't do it, you have to declare the variable as global in each function

12 years ago | 1

Answered
how to plot using two x axes
Use plotyy function Look at this example x1=1:0.1:10 x2=1:0.1:10 y1=sin(x1) y2=cos(x2)./x2 [ax,h1,h2] = plotyy(x1,y1...

12 years ago | 0

Answered
How to make a List box?
Use <http://www.mathworks.com/help/matlab/ref/listdlg.html listdlg> function

12 years ago | 0

Answered
How do I get simulink to run my model in real time?
The better way to do it is to use the toolbox: <http://www.mathworks.com/products/rtwt/description2.html Real Time Windows Targ...

12 years ago | 0

| accepted

Answered
removing spaces from a cell array
G(cellfun(@isempty,G))=[]

12 years ago | 0

| accepted

Answered
calculating cdf with a matrix as an argument
cdf = .5*(1+erf((delta-mu)/(sqrt(2*sigma^2))))

12 years ago | 1

| accepted

Answered
How to find repeated array in a matrix
You can use |ismember| and |find| function

12 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals .. ERROR
Your function |inv| is erased by the variable inv inv=inv(D+aL) change it to inv1=inv(D+al)

12 years ago | 1

| accepted

Answered
how to view contents of cell arrays of different size
celldisp(z1)

12 years ago | 0

Answered
Definitive answer on the correct str2double behavior for the string '10 20'
str2num('10 20') will give an array, maybe that's what your colleague has used

12 years ago | 0

Answered
The current folder window
Try to restore the default layout desktop = com.mathworks.mde.desk.MLDesktop.getInstance; desktop.restoreLayout('Default')...

12 years ago | 17

Answered
How to collect results in a table or graph?
Use uitable function

12 years ago | 0

Answered
"OR" not working
This is correct 5==1 The result is 0 0|2 the result is 1

12 years ago | 2

| accepted

Answered
find X of corresponding local minima
You can use [a,idx]=findpeaks(Fx,'MINPEAKHEIGHT',100) b=T(idx)

12 years ago | 1

Answered
Replacing values in a column vector.
A=randi([0 20],20,1) % Example a1={0 1 [2 3] 4 [5 6 13] [7 8 9] [10 11 12 16 ] [14 15 17 18 19 20]} % Numbers to be repla...

12 years ago | 1

| accepted

Answered
Really need a help on plotting this simple plot into 3D plot
If M is your matrix with three column comp=M(:,1); temp=M(:,2) pres=M(:,3) plot3(temp,comp,pres) grid

12 years ago | 0

Answered
Read names of images from text file and read using imread
f=fopen('file.txt'); s=textscan(f,'%s '); fclose(f); out=s{1}; for k=1:numel(out) filename=out{k} %do end

12 years ago | 0

Answered
How I can multiply 2 variables without losing precision
You can check that a*b and 5468.7 are not equal a*b==5468.7 Now try this format long c=a*b

12 years ago | 1

| accepted

Answered
Sorting Cell Array Elements in Multiple Columns
A={1 100 0 [6,7,8,9,10,11,12] 2 110 0 [6,7,8,9,10,11,12] 25 35 [5,14] [6,7,8,9,10,11,12] 35 38 4 [6,7,8,9,10,11,12] 36 37 ...

12 years ago | 0

| accepted

Answered
Inner matrix dimensions must agree?
When you multiply or divide two vectors, element by element, you need to add a dot (.) before your operator, in your case: |.*| ...

12 years ago | 0

Answered
Having Trouble with My Input Argument!
function output=myfun(x) if x<-2 output=-x^2; elseif -2<=x && x<0 output=-2*x; elseif 0<=x && x<=2 output...

12 years ago | 1

| accepted

Answered
User input folder name?
foldername = inputdlg('Please enter output folder name:'); mkdir(foldername{1})

12 years ago | 1

| accepted

Answered
Saving part of a cell array
You can do it, but it's really a bad idea, you can access any part of your cell by test{1,n} For more details read <htt...

12 years ago | 0

| accepted

Answered
How to create zeros between ones in array
A=[0 0 0 1 1 1 1 0 0 0] AA=[0 A 0] i1=strfind(AA,[0 1])+1 i2=strfind(AA,[1 0])-2 for k=1:numel(i1) A(i1:i2)=0; end ...

12 years ago | 0

| accepted

Answered
How to merge the scope1 two graph into one graph
Use Mux block with a scope with one channel,

12 years ago | 0

Answered
How to accept time from the user into a matrix?
d=input('choose 3 time in this form 8:00 8:30 9:00 ','s') e=datenum(regexp(d,'\S+','match'))

12 years ago | 1

| accepted

Answered
Creation of a "Status Bar" plot, displaying machine statuses (ON, OFF, Standby)
x=[0 1 1 2 2 4 4 5 ] y=[2 2 1 1 0 0 2 2] subplot(211),plot(x,y) subplot(212), in={'off','sb','on'} cl={...

12 years ago | 0

Load more