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

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 1

| accepted

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

2 months ago | 0

Answered
[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...

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

| accepted

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

2 months ago | 0

| accepted

Answered
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'

3 months ago | 0

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

3 months ago | 0

| accepted

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

3 months ago | 0

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

3 months ago | 0

Answered
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")

3 months ago | 1

| accepted

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

3 months ago | 0

Answered
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

3 months ago | 0

Answered
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(:,...

3 months ago | 0

| accepted

Answered
grabbing specific rows from matrix
RowSelection=[1 5 13 21 25]; xy_index(RowSelection ,:)

3 months ago | 0

| accepted

Answered
How to programmatically rename all instances of a signal/variable in a Simulink model?
It is NOT a signal. Rather, it is a "Bus Element In" "Inport" block. blks=find_system('ModelName','FindAll','On','BlockType','I...

3 months ago | 0

| accepted

Answered
Copy file and immediately read in content
In your script, try adding "rehash" after the line where the file is copied. doc rehash Use rehash with no arguments only whe...

3 months ago | 1

| accepted

Answered
How do I collect unlinked block or library list.
find_system('ModelName','LookUnderMasks','All','FollowLinks','On','LinkStatus','inactive')

3 months ago | 0

| accepted

Answered
How to close a dos window after a .exe is finished running?
I have provided this solution in several cases. You just need to have an empty line with a carriage return in that text file. ...

3 months ago | 0

| accepted

Answered
How to get the label name when I enable the property of signal propagation
ph=get_param('PathToTheFromBlock','PortHandles'); get_param(ph.Outport,'PropagatedSignals')

3 months ago | 0

Answered
Is it possbile to protect the code of a matlab live script?
make a p code. doc pcode

3 months ago | 0

Answered
How can I remove this projection from Matlab plot?
Using mesh(), not using meshc(), will not show the contour.

3 months ago | 0

| accepted

Answered
How do I compile a simulink model without running it?
See if this is what you need. It is equivalent to manual press Ctrl+D set_param(model,'SimulationCommand','Update')

3 months ago | 0

Answered
In Merge block, For execution of more than one subsystem(Nested If loops) I have an error saying Ensure that the Merge block output is updated by only one of its input signals
You need to re-construct your model. At any time, there should be at most one of the inputs at the Merge block being updated. A...

3 months ago | 0

| accepted

Answered
Numerical Precision Physics Calculations
eps(5.89e7) It means that around 5.89e7 (which is a large value), the nearest values that can be represeted by double data type...

3 months ago | 1

| accepted

Answered
How to Remove Customizatize Simulink Menu items
Most likely, it is added through a sl_customization.m file provided in the third party software . If you know the installation ...

3 months ago | 0

| accepted

Load more