Respondida
Help with comparing strings from cells
A{1,5} itself is a cell. Do the following class(A{1,5}) isequal(char(A{1,5}),'FIRING') A{1,5}{1}

alrededor de 3 años hace | 0

| aceptada

Respondida
i am trying to display the dialog parameters of all blocks in a simulink model. But i am not getting the exact result. Can anyone help me in this?
"paramValue" turns to be a struct. All its field values are struct, so your code ends up running this line for all iterations. ...

alrededor de 3 años hace | 0

| aceptada

Respondida
How to insert an input in a constant in simulink?
Use the "Assignment" block to assign values to specified elements of a multi-dimensional signal.

alrededor de 3 años hace | 0

Respondida
Changing size of variable inside Matlab function in SIMULINK
Use variable size data. It can be done but a little tricky. https://www.mathworks.com/help/releases/R2022b/simulink/ug/declare-...

alrededor de 3 años hace | 0

| aceptada

Respondida
Is there a way to set the default behavior for `format` statement?
no big deal. Put that in a startup.m file Also, set it in MATLAB Preference, Command Window, Text Display

alrededor de 3 años hace | 1

Respondida
Single plot title line with multiple text interpreters?
title( [ 'HSRL2 Ocean b_b_p Retrieval From' , strrep(filenameHBW,'_','\_') ] )

alrededor de 3 años hace | 2

Respondida
how to add several inport to the buscreator
set_param('untitled/BusCreator','Inputs','3'); add_line('untitled','Inport/1','BusCreator/1') add_line('untitled','Inport1/1',...

alrededor de 3 años hace | 0

| aceptada

Respondida
Simulation status is stopped but I cannot start new simulation from script because Matlab assumes it is still running
Might it be too fast to re-start the simulation? There could be some post-simulation processing going on. Anyway, in the M-scri...

alrededor de 3 años hace | 0

Respondida
Is it possible to "Edit table and breakpoints" for a LUT within a masked subsystem?
On the dialog of the Lookup Table block, you provide the variable name to pass to the Lookup Table block. On the dialog of the ...

alrededor de 3 años hace | 0

Respondida
Display without new line
use sprintf() and check "doc sprintf" to learn the % Formatting Operator sprintf('format short: %f',x) sprintf('format short: ...

alrededor de 3 años hace | 0

Respondida
Error Messages keep popping up: "Undefined function or variable"
up case, low case

alrededor de 3 años hace | 0

Respondida
Create a repeating sequence without interpolation
I found it impossible to use the "Repeating Sequence" block due to the "breakpoints must be strictly monotonically increasing" ...

alrededor de 3 años hace | 0

Respondida
Variables are stored but not shown is the workspace?
The variable name "ans" is reserved by MATLAB. type "doc ans" to read it

alrededor de 3 años hace | 0

Respondida
I am unable to understand what's wrong in this code.
if fid < 0 || ~ischar(character) fprintf('-1'); charnum=-1; return end

alrededor de 3 años hace | 0

Respondida
how can I change a sequence so that the values of the sequence are zero if the the result division by 2 is not an integer in MATLAB?
x=[0 1 2 3 4]; y=x; index=mod(x,2)~=0; y(index)=0

alrededor de 3 años hace | 0

| aceptada

Respondida
How to get the exact file pathname for a linked library
save_system() has options to skip prompt, ignore warning and force save. If there are multiple files with the same name as the ...

alrededor de 3 años hace | 0

Respondida
Make Timer in Simulink
It might be easier to implement it through Simulinnk block diagram, similar to this one. https://www.mathworks.com/matlabcentra...

alrededor de 3 años hace | 1

| aceptada

Respondida
convert 16bit char to 4 byte hex values
c=char(["1000100010001000"; "0000000000000010"; "1111111111111111"]) d=dec2hex(bin2dec(c))

alrededor de 3 años hace | 0

Respondida
Delete every nth element in array and increasing 1 NaN value per new row
nRow=15; nCol=10; Array=repmat(1:nCol,nRow,1); for k=1:nRow index=mod((1:nCol),k+1)~=1; Array(k,index)=nan; end A...

alrededor de 3 años hace | 0

Respondida
How can you populate a cell array horizontally to get correct data in columns?
reshape(datare,28,[]) and then transpose() data=num2cell(1:80); datare = reshape(data,1,[]); web = reshape(datare,8,[]); tra...

alrededor de 3 años hace | 1

| aceptada

Respondida
block first row of a cell
value = {'Value';'8126';'5354';'1406';'4265'}; name = {'Name';'B';'A';'N';'R'}; union = [name,value]; B = sortrows(union(2:en...

alrededor de 3 años hace | 0

Respondida
One-time data import into Simulink
What you need to do are: Load the 10001x5 matrix into MATLAB base workspace. This just needs to be done once and can be done th...

alrededor de 3 años hace | 0

| aceptada

Respondida
How I write an exist inside a for loop that will continue if the variable does not exist?
exist('wrist', 'var'), not exist(wrist, 'var') exist('wrist', 'var'), not exist('wrist{k}', 'var') I suggest using try-catch ...

alrededor de 3 años hace | 0

| aceptada

Respondida
N-D Look up Tables
You have a 10000x8 table. The first seven columns (10000x7) data is all the possible combinations of the seven input variables. ...

alrededor de 3 años hace | 0

| aceptada

Respondida
Is there a path in the string?
You can utilize the exist() function. Assume you are at the c:\root folder, and there is a \report sub-folder exist('\report',...

alrededor de 3 años hace | 1

Respondida
Stream data from function to workspace in real time
Use the MATLAB Function block.

alrededor de 3 años hace | 0

Respondida
Simulink: Class instance as output of a MATLAB function block
If involving object and class, use the MATLAB System block, although, you can't output an "object". You can utilize the methods ...

alrededor de 3 años hace | 0

Respondida
keep getting an error message saying might be missing a closing bracket, causing invalid syntax at y, but the bracket is there. (line 34)
You can paste the text, instead of attaching a snapshot picture. I believe there is a mistake in defining the odeFun. There is ...

más de 3 años hace | 0

Respondida
Simulink Switch doesn't propagate rate transition
Not sure what you exactly mean, but a Signal Specification block can specify any rate you want.

más de 3 años hace | 0

Respondida
Can I link optimization code with Simulink file?
In the most common case, you run the code above, all the variables will be created in the base workspace. If your Simulink model...

más de 3 años hace | 0

Cargar más