Answered
How to keep the date data included in a file when they are imported into MATLAB?
>> a=importdata('test.dat') a = data: [3x4 double] textdata: {3x1 cell} rowheaders: {...

10 years ago | 0

Answered
How to print blank rows on top of CSV file
Yes. It should give you a blank row. Print a whitespace should also do it. fid=fopen('test.csv','w+t'); fprintf(fid,'\n'...

10 years ago | 0

| accepted

Answered
what is the fastest way to convert a cell array of delimited numbers into a matrix
a={'1,5012,0,35,6';'2,395,1,35,8'}; b=str2num(char(a)) b = 1 5012 0 35 6...

10 years ago | 1

Answered
setdiff for two matrices
setdiff(a,b,'rows') ??

10 years ago | 0

Answered
Compare 2 dimensional matrix for same pair elements
a = [1,1,2,3,3,4,5,6,6;2,3,1,4,5,1,2,3,5]; b = [1,2,4,3,3,5;2,1,2,5,4,2]; aa=a.'; bb=b.'; index=ismember(aa,bb...

10 years ago | 1

| accepted

Answered
Get plot of designed root locus from control system designer
The function is rlocus(). You do need the Control System Toolbox. h = tf([2 5 1],[1 2 3]); rlocus(h)

10 years ago | 0

Answered
Hello, How to clip a sine wave only on positive axis?
Use the MinMax block. Take a "Min" operation with the constant of 3 should do it.

10 years ago | 0

| accepted

Answered
concatenate different data type matrices
lower case, cat(), not CAT().

10 years ago | 0

| accepted

Answered
How to find enumerated constant block inside the model using command line?
There is no "Enumerated Constant" block type. It is a masked SubSystem block. You need to use: find_system('testmodel','MaskT...

10 years ago | 0

| accepted

Answered
How do I froce MATLAB to wait for Simulink simulation to be paused or stopped before resuming ?
You are trying to constantly monitor the "SimulationStatus" of your model. That is not efficient. I wonder, in the callback o...

10 years ago | 0

Answered
Is there any function which returns the content of a variable as string?
num2str(); mat2str()

10 years ago | 0

Answered
Deleting elements in cell array constrained by logic
B = [0,0,0,1,1,0,0,0,0,0,0]; A = {[4,2,5],[3,5,7],[2,3,8],[4,5,6]}; NewA=cellfun(@(x) x(~ismember(x,find(B))),A,'uni...

10 years ago | 0

| accepted

Answered
I want to return back to a certain loop
There is no "goto" statement in MATLAB if that is what you are looking for. I think your task could be solved with a recursive f...

10 years ago | 0

Answered
how to display the name of an input function by a function functions?
fhandle=@sin; func2str(fhandle) ans = sin

10 years ago | 0

Answered
Initialize logic block simulink
# There is no "initial condition" in a Simulink Logical Operator block. The output is solely dependent on the input/inputs. # B...

10 years ago | 0

Answered
Undefined function or variable "sum".
check the syntax of the sum() function Syntax B = sum(A) B = sum(A,dim) B = sum(..., 'double') B = sum(..., dim...

10 years ago | 1

| accepted

Answered
I have implemented if else structure in stateflow. But I keep getting warning "transition has an action with no side effect" for the action transition for the if and else part. What does this mean?
Inside {} should be action statements, such as assignments, e.g. action=20; action==20 is a condition. Pay attention to th...

10 years ago | 0

| accepted

Answered
Can I commercially sell software I create using Matlab GUI?
Yes. Royalty-free distribution of applications to users who do not need MATLAB http://www.mathworks.com/help/compiler/pro...

10 years ago | 0

Answered
error in using year()
There must be a variable called "year" in the workspace. Try this: year=2002*ones(120,1); Year = year('05-Aug-2003') It...

10 years ago | 0

Answered
How do I rename a structure?
This is primarily due to the fact that the top level structure name of your data is varying and the name is long. You can use "d...

10 years ago | 0

| accepted

Answered
How do I get Simulink Model Properties to workspace? Especifically Model history logs..
You can use get_param(ModelName, ParameterName) to get the needed info. Depending on the Simulink version, refer to the docu...

10 years ago | 0

| accepted

Answered
repeated -append sometimes fails with permission denied
Use rehash after saving the file might solve this issue. From the help text of rehash: The only time one should need to use ...

10 years ago | 0

Answered
How to break a for loop but then continue with the rest of code
Use continue or break to control the for-loop. help continue help break

10 years ago | 0

Answered
Is there a way to detect embedded matlab function inside a subsystem in a complex simulink model?
In Command Window, run this command Blocks=find_system(YourRootLevelModel,'FollowLinks','On','LookUnderMasks','All','MaskDe...

10 years ago | 0

Answered
Extract Submatrix with Logical Indexing Including Zeros
C=A.*B Or, if insisting on "logical indexing" D=zeros(size(A)) D(B)=A(B)

10 years ago | 1

| accepted

Answered
How to concatenate horizontally multiple text files in a folder to have all data in one txt file?
The old fashion DOS command copy could do the task. You can also call it in MATLAB using system(). The trick is the "+" symbol. ...

10 years ago | 0

| accepted

Answered
Is there a simple way to set a property of multiple (potentially different) objects in a cell array?
This might be hard. cellfun() won't apply either. However, I know that if I have an array of the object handles, set(ArrayOfObje...

10 years ago | 0

Answered
How can I return the minimum value that is not zero inside a for loop?
How about using a temp variable? temp=hourdata(months==i,1:end); temp(temp<=0)=inf; mins(i,:) = min(temp,[],1); cl...

10 years ago | 1

Answered
FOR loop merge plots
Since you have multiple plots, you can use figure() to specify which window to plot on. Use hold on if you want to plot the curv...

10 years ago | 0

| accepted

Answered
Reference to non-existent field 'xData'
It is most likely due to compatibility issues between different versions of Simulink version. You might be using R2009a to open ...

10 years ago | 0

Load more