Beantwortet
Remove all remaining charaters once the first non digit occurs within a vector of an array and keep everything before the non digit
a={'22702270|1|60'; '2270|1|60'; '227022702270|1|60'}; b=regexprep(a,'\|.+','') b = '22702270' ...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
How can I speed up fread(), fwrite() ?
Theoretically, it takes 4 seconds to send 57600 bytes at 115200 bit rate. 57600*8/115200 =4

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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: {...

mehr als 10 Jahre vor | 0

Beantwortet
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'...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 1

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

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 1

| akzeptiert

Beantwortet
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)

mehr als 10 Jahre vor | 0

Beantwortet
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.

mehr als 10 Jahre vor | 0

| akzeptiert

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

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

mehr als 10 Jahre vor | 0

Beantwortet
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

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 1

| akzeptiert

Beantwortet
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. ...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 1

Mehr laden