Beantwortet
Why aren't global variables being recognized in Simulink model explorer?
Double click "MATLAB Function1" to open the Editor, click "Edit Data" button, add data "B" as a "Data Store Memory".

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Locate MATLAB Class Definition File
'datetime' is a MATLAB class. a=datetime which datetime

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Variable not recognized from workspace parameter
In the MATLAB Function block editor, click "Edit Data", specify "Bm" as a "parameter"

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Plot Array in Simulink scope
Use a "From Workspace" block to read the data from the workspace to Simulink, then connect the output to a Scope. To show in a...

mehr als 3 Jahre vor | 0

Beantwortet
How can I nest a function in a function?
MyAD=AD(3) function AD = AD(n) A = hilbert(n); Ainv = A\eye(n); Eye = eye(n); AD = Eye-Ainv*A; end function A = hilbe...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to use parameters from data dictionary in sinmulink's callback function?
Use API to open the data dictionary and get the value, or the easiest thing to do is Simulink.data.evalinGlobal('modelName','x'...

mehr als 3 Jahre vor | 0

Beantwortet
How to combine two binary columns
a=[0 1 0 0 1;1 0 1 1 0] s=sprintf('%d%d\n',a(:)) Or b=dec2bin(a) c=reshape(b,2,[]) d=c'

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
get elements at x from array A without loop
A=10:10:90; B=[1,1,3,6,7,5,4]; C=A(B)

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
figure saving in created folder. Error using savepath: invalid or missing path
This is really dumb. In your code, the mkdir() line, there is an extra whitespace in front of 'flow_speed'. So you created a f...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to change simulink variable from matlab script?
You can use set_param(). block='PT1/Transfer Fcn'; a=get_param(block,'Denominator') b=eval(a) b(2)=1.5 c=mat2str(b) set_pa...

mehr als 3 Jahre vor | 1

Beantwortet
How schould the matlab function be to hold an signal between two values?
The Relay block does exactly that.

fast 4 Jahre vor | 2

Beantwortet
How to get all block parameters from a simulink block?
Use the function that is provided by TargetLink. I used it before but can't remember the name, something like tl_clear_system()?...

fast 4 Jahre vor | 0

Beantwortet
ismember for cell arrays of different sizes
bin_list = {[1], [1,7], [1,7], [1,7,9], [2,8], [3], [1,7]}'; Const=1; f=@(x) ismember(Const,x); cellfun(f,bin_list)

fast 4 Jahre vor | 0

Beantwortet
PID block has underspecified signal dimensions, ALL groundblocks affected
I saw this quite often. I think the cause is that the Ground block doesn't have its Dimension (or size) info defined, not even a...

fast 4 Jahre vor | 0

Beantwortet
figure saving in created folder. Error using savepath: invalid or missing path
add "rehash" after the folder is created. doc rehash

fast 4 Jahre vor | 0

Beantwortet
How to list all blocks that "InitialOutput" parameter is accessible in their "block parameter" interface?
If you look at the help document of the Outport block, it says the "Initial Output" property is valid when the Outport block is ...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
How do I execute S-function Block from .m script.
Select the block, right click, select "Properties ...". Click the "Callbacks" tab, select OpenFcn, there should be some type o...

fast 4 Jahre vor | 0

Beantwortet
[Simulink] I want to just switch two values with positive trigger
Use the trig signal to trig a "triggered subsystem", the trigger type is "rising". Inside the subsystem is a "Not" logical block...

fast 4 Jahre vor | 1

Beantwortet
Simulink Transmission Shift Map
It is possible and you are almost there. You have the logic to check whether the speed is increasing (for up shipt) or else (f...

fast 4 Jahre vor | 0

Beantwortet
fprintf with warning of a lone trailing backslash
Change to fprintf(['\nProcessing folder %s', folderName]); '\n' is fine, it produces a carriage return Just need the '%s' to...

fast 4 Jahre vor | 0

Beantwortet
Can Simscape models be build programmatically?
I tried this and the block was added. To figure out for other blocks, open the library file, select the block and run "gcb" in M...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to use correctly the "1-D Lookup Table"
Mostly correct. Just need a few settings Press Ctrl+E to open the configuration parameters, set the Solver to be fixed step, di...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Read the last row of excel spreadsheet using actxserver
I hope this debug message gives you a clue. K>> Workbook.Sheets.Item(1).UsedRange.Address ans = '$A$1:$AY$83'

fast 4 Jahre vor | 0

Beantwortet
How to make MATLAB run a built-in function instead of a custom function?
Remove that (H: Drive) folder from your MATLAB path, or move it below the (C: Drive) folder that contains that built-in function...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
How do I tell Matlab to use the proper "range" function?
Run "which -all range". The first one is used. The rests are shadowed, or private which will not affect you. The 'the basic "r...

fast 4 Jahre vor | 0

Beantwortet
How do I copy 2 .slx in 1 .slx ?
The best way is to use model reference. Add two "Model" blocks, each specified as reference to m1.slx and m2.slx The other way ...

fast 4 Jahre vor | 0

Beantwortet
How to get a logical output if all the arrays of a matrix are NAN and the matrix is a string
F=["NA" "NA" "NA" "NA" "NA" "NA" "NA" "NA"]; all(F=="NA")

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
How can I use a variable to set the file name using Simulink's "too file" block?
As for as I know, what you imagined can not be done. In your MATLAB script, you have to modify the parameter of the "ToFile" blo...

fast 4 Jahre vor | 0

Beantwortet
highting single plot among lots of plots on the same figure
Click menu Tools -> Link select one of the ten rows in the pop-up dialog, the corresponding curve will become bold

fast 4 Jahre vor | 0

Beantwortet
How to keep a specific value in binary matrix with column constraint?
N=10; A=eye(N); B=A(:,randperm(N));% shuffle the Identity matrix randomly RandCol=randi(N-1); B(:,RandCol)=B(:,RandCol)+B(:,...

fast 4 Jahre vor | 0

| akzeptiert

Mehr laden