Answered

Option to confirm tab auto-completion with 'Enter'

MATLAB Preferences, Editor/Debugger, Automatic Completions Command Window, Automatic Completions

Option to confirm tab auto-completion with 'Enter'

MATLAB Preferences, Editor/Debugger, Automatic Completions Command Window, Automatic Completions

3 meses ago | 0

Answered

Real time, Matlab, SpeedGoat, Simulink, read write data, Solution?

To store runtime data like "A" in your example, use "Data Store Memory" block in your Simulink model. Use "Data Store Read" and ...

Real time, Matlab, SpeedGoat, Simulink, read write data, Solution?

To store runtime data like "A" in your example, use "Data Store Memory" block in your Simulink model. Use "Data Store Read" and ...

3 meses ago | 1

| accepted

Answered

matlab R2020b randperm fuction is not random

Duh! You store the result in "order" and display it again. Of course they are the same! order = randperm(10) disp(order) orde...

matlab R2020b randperm fuction is not random

Duh! You store the result in "order" and display it again. Of course they are the same! order = randperm(10) disp(order) orde...

3 meses ago | 1

| accepted

Answered

Identifying data in plot from legend.

This might help. On the figure window, click the "Link/Unlink plot" button, or select menu "Tools", check "Link". On the pop-up...

Identifying data in plot from legend.

This might help. On the figure window, click the "Link/Unlink plot" button, or select menu "Tools", check "Link". On the pop-up...

3 meses ago | 0

Answered

how to set port using loop indexing instead of defining every node pair explicitly.

setports(ckt,port_node(1,:),port_node(2,:),port_node(3,:)) or b=mat2cell(port_node,ones(size(port_node,1),1),size(port_node,2)...

how to set port using loop indexing instead of defining every node pair explicitly.

setports(ckt,port_node(1,:),port_node(2,:),port_node(3,:)) or b=mat2cell(port_node,ones(size(port_node,1),1),size(port_node,2)...

3 meses ago | 0

| accepted

Answered

Finding the mean of every 24 elements of 3rd dimension of a 3d array

Something like this. Try simple example to make sure the dimension, row, column are right. a=ones(2,3,10); b=mean(reshape(a,2,...

Finding the mean of every 24 elements of 3rd dimension of a 3d array

Something like this. Try simple example to make sure the dimension, row, column are right. a=ones(2,3,10); b=mean(reshape(a,2,...

3 meses ago | 0

| accepted

Answered

What do we mean by for example result=uint8(result)

change the data type to uint8 a=1 class(a) b=uint8(a) class(b)

What do we mean by for example result=uint8(result)

change the data type to uint8 a=1 class(a) b=uint8(a) class(b)

3 meses ago | 1

Answered

How to delete inports of a bus creator using script ?

I tried this on a simple example with 8 inports. %% lh=get_param('PathToBusCreator','LineHandles'); in_lh=lh.Inport([6:8]); ...

How to delete inports of a bus creator using script ?

I tried this on a simple example with 8 inports. %% lh=get_param('PathToBusCreator','LineHandles'); in_lh=lh.Inport([6:8]); ...

3 meses ago | 1

Answered

Error "Argument to dynamic structure reference must evaluate to a valid field name." What did I wrong?

T_1=linspace(0,160,160); T=T_1+273.15; A= -181.587; B= 8632.13; C= 24.7981; D= 0; H12= 1./(exp(A+(B./T)+(C*log(T))+(...

Error "Argument to dynamic structure reference must evaluate to a valid field name." What did I wrong?

T_1=linspace(0,160,160); T=T_1+273.15; A= -181.587; B= 8632.13; C= 24.7981; D= 0; H12= 1./(exp(A+(B./T)+(C*log(T))+(...

3 meses ago | 1

| accepted

Answered

How can we understand the "the dimensions of output port" in the sentence?

In the S-function code, you need to define the dimensions (or size) of the outport 2. You must have defined the size of outport ...

How can we understand the "the dimensions of output port" in the sentence?

In the S-function code, you need to define the dimensions (or size) of the outport 2. You must have defined the size of outport ...

3 meses ago | 0

Answered

Opening .prj file with MATLAB 2016b

I think the concept of MATLAB Project does not exist in R2016b. I don't remember the exact starting version but the help documen...

Opening .prj file with MATLAB 2016b

I think the concept of MATLAB Project does not exist in R2016b. I don't remember the exact starting version but the help documen...

3 meses ago | 1

Answered

How to pass value to local scope Data store memory block without making it global

A local data store can still cover a large portion of a model. It is like a tree. If you place the Data Store Memory block at a ...

How to pass value to local scope Data store memory block without making it global

A local data store can still cover a large portion of a model. It is like a tree. If you place the Data Store Memory block at a ...

3 meses ago | 0

Answered

How can I solve the following error?

Most likely, you have a variable called "sum". Clear it first and then run your code clear sum; A=magic(5); sum(A,2)

How can I solve the following error?

Most likely, you have a variable called "sum". Clear it first and then run your code clear sum; A=magic(5); sum(A,2)

3 meses ago | 1

Answered

Selecting multiple array elements

n = 10; A = zeros(n); B = A; k = [1 1; 2 3; 4 5; 1 8; 8 6]; A(k(1,1),k(1,2))= 1; A(k(2,1),k(2,2))= 1; A(k(3,1),k(3,2))= 1;...

Selecting multiple array elements

n = 10; A = zeros(n); B = A; k = [1 1; 2 3; 4 5; 1 8; 8 6]; A(k(1,1),k(1,2))= 1; A(k(2,1),k(2,2))= 1; A(k(3,1),k(3,2))= 1;...

3 meses ago | 0

| accepted

Answered

Difference between matlab ss function and Simulink State-Space block

https://www.mathworks.com/help/control/ref/lti.lsim.html There are limited number of settings when calling lsim(sys,u,t,x0,meth...

Difference between matlab ss function and Simulink State-Space block

https://www.mathworks.com/help/control/ref/lti.lsim.html There are limited number of settings when calling lsim(sys,u,t,x0,meth...

3 meses ago | 0

Answered

Programmatically get propagated datatype of a block

Something like model([], [], [], 'compile') get_param('BlockPath','CompiledDataType') model([], [], [], 'term') You can use ...

Programmatically get propagated datatype of a block

Something like model([], [], [], 'compile') get_param('BlockPath','CompiledDataType') model([], [], [], 'term') You can use ...

3 meses ago | 0

Answered

Create a time vector

My answer to your previous question is the answer. Just change seconds(1) to seconds(1/fs) https://www.mathworks.com/matlabcent...

Create a time vector

My answer to your previous question is the answer. Just change seconds(1) to seconds(1/fs) https://www.mathworks.com/matlabcent...

3 meses ago | 0

Answered

Create Structure from cell array with dot separation in string

If your question comes down to whether "em1500.eta_t.x" can be made a field name, then the anser is No. It is an invalid field n...

Create Structure from cell array with dot separation in string

If your question comes down to whether "em1500.eta_t.x" can be made a field name, then the anser is No. It is an invalid field n...

3 meses ago | 0

Answered

Create a time array

val=['17-10-58_086' '17-11-09_923'] StartEnd=datetime(val,'InputFormat','HH-mm-ss_SSS') TimeVector=StartEnd(1):seconds(1)...

Create a time array

val=['17-10-58_086' '17-11-09_923'] StartEnd=datetime(val,'InputFormat','HH-mm-ss_SSS') TimeVector=StartEnd(1):seconds(1)...

3 meses ago | 0

Answered

Simulink model not plotting my Sine

I understand this might be just an exercise to learn Legacy Code Toolbox and S-function, but there are a couple of things wrong ...

Simulink model not plotting my Sine

I understand this might be just an exercise to learn Legacy Code Toolbox and S-function, but there are a couple of things wrong ...

3 meses ago | 0

| accepted

Answered

Why Unrecognized function or variable 'set_point'?

The variable that you are looking for, "set_point",is in "out.set_point". So, in your code, replace "set_point" with "out.set_p...

Why Unrecognized function or variable 'set_point'?

The variable that you are looking for, "set_point",is in "out.set_point". So, in your code, replace "set_point" with "out.set_p...

3 meses ago | 1

Answered

How to press any key to continue after running a command prompt

This is an old technique. Run command as TDF2CSV.exe file2convert.TDF << Dummy.txt where Dummy.txt is a text file which contai...

How to press any key to continue after running a command prompt

This is an old technique. Run command as TDF2CSV.exe file2convert.TDF << Dummy.txt where Dummy.txt is a text file which contai...

3 meses ago | 0

Answered

why I'm getting error in MATLAB function block coding showing that parse error?

Change the last line [d1 d2] = [Po P1ref] to d1 = Po; d2 = P1ref; or [d1 d2] =deal(Po, P1ref)

why I'm getting error in MATLAB function block coding showing that parse error?

Change the last line [d1 d2] = [Po P1ref] to d1 = Po; d2 = P1ref; or [d1 d2] =deal(Po, P1ref)

3 meses ago | 0

Answered

How to find a user based on full name and eight digit number

On this page, click "More" and then "Contributors" On that page, the serch box is for "Search Contributors". Type in "per isak...

How to find a user based on full name and eight digit number

On this page, click "More" and then "Contributors" On that page, the serch box is for "Search Contributors". Type in "per isak...

3 meses ago | 0

Answered

Reset Repeating Sequence Block

If you look inside the mask of the "Repeating Sequence" block, you will see it is built on top of the 1-D lookup table. To achi...

Reset Repeating Sequence Block

If you look inside the mask of the "Repeating Sequence" block, you will see it is built on top of the 1-D lookup table. To achi...

3 meses ago | 1

| accepted

Answered

"brake" not working in Matlab 2021b - is there a fix or work around?

"break", not "brake"

"brake" not working in Matlab 2021b - is there a fix or work around?

"break", not "brake"

3 meses ago | 0

Answered

Href hyperlink, how to escape double quotes " ?

knowing double('"') char(34) This leads to the following, which works out properly disp('<a href="matlab:system([''explorer....

Href hyperlink, how to escape double quotes " ?

knowing double('"') char(34) This leads to the following, which works out properly disp('<a href="matlab:system([''explorer....

3 meses ago | 0

| accepted

Answered

how to extract n elements from a vector and store them in a matrix

a = [3 6 0 3 8 4 9 1 2 4 9 3 2 5 7 0 1 2]; b = [5 6 5 3 1 3 8 2 2 3 5 7 1 2 6 1 6 7]; c = [0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0...

how to extract n elements from a vector and store them in a matrix

a = [3 6 0 3 8 4 9 1 2 4 9 3 2 5 7 0 1 2]; b = [5 6 5 3 1 3 8 2 2 3 5 7 1 2 6 1 6 7]; c = [0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0...

3 meses ago | 3

Answered

which is the right syntax with find_system and blocktype

Using 'sm_lib/Joints/Weld Joint' for block type is incorrect. To find it out, do it manually first. Select the block, run get_pa...

which is the right syntax with find_system and blocktype

Using 'sm_lib/Joints/Weld Joint' for block type is incorrect. To find it out, do it manually first. Select the block, run get_pa...

3 meses ago | 0