Answered
Where is Switch (Relay) in Simulink?
https://www.mathworks.com/help/physmod/sps/ref/spdtrelay.html?s_tid=doc_ta https://www.mathworks.com/help/simulink/slref/manual...

4 years ago | 0

| accepted

Answered
How do you quickly format plots from the scope in Simulink?
Instead of using Scope, save the signal data using "To Workspace" or "To File" block. Write a M-script function to plot. see pl...

4 years ago | 0

Answered
MATLAB Puts One space between %'s (Comment)
I think that is the exact reason to add "%" and a space for "Ctrl+R", to avoid making "%%" by pressing "Ctrl+R" twice. Adding "...

4 years ago | 0

Answered
issue with using a variable for path name
cd(Path). avoid using 'Path' as variable name as path() is a function.

4 years ago | 0

| accepted

Answered
How to get current URL from web browser using matlab?
If you are willing to do copy&paste, you can do this in MATLAB txt=clipboard('paste')

4 years ago | 0

Answered
Libraries equivalent for referenced subsystems
The library option in find_system() 'FollowLinks', 'on' or 'off' Also 'LookInsideSubsystemReference', 'on' or 'off' See doc ...

4 years ago | 0

Answered
Road Roughness in simulink
It seems normal to me. The acceleration has positives and nagatives, thus the speed shows rising and falling, but because all th...

4 years ago | 0

| accepted

Answered
How to change port font color in Matlab Function Block in Simulink
It looks like block mask. Select the block, press Ctrl+M, check the "icon drawing commands".

4 years ago | 0

Answered
cannot extract data from figure with multiple lines
The other two "curves" are created using stairs(). use findobj(fig,'Type','Stair') to find those. fig = openfig('traj.fig'); >...

4 years ago | 0

| accepted

Answered
Not enough input arguments from a row vector
myquad(3,4,5)

4 years ago | 0

Answered
My matlab can no longer import csv with struct by using dir
dir() is a function yet you use "dir" as a variable name on the first line. Use a different name.

4 years ago | 1

Answered
How to return information of multiple modules selected in Simulink
I use 'regexp' b=find_system(bdroot,'regexp','on','Selected','on','BlockType','Gain|Outport')

4 years ago | 0

| accepted

Answered
How to find specific text in a string?
a="abs(3).def(5).hhh(11)"; regexp(a,'(\d+)')

4 years ago | 0

Answered
Exporting sampled data from figure to matlab.
t=0:0.01:10 SinCurve=plot(t,sin(t)); XData=SinCurve.XData; YData=SinCurve.YData; NewX=resample(XData,5,3); If you only ...

4 years ago | 1

| accepted

Answered
Append apostrophe as a text in a function for a searching tool
Find a .mat file in your current folder and try this: name='MyData.mat'; folder=pwd; filename=fullfile(folder,name); data=lo...

4 years ago | 1

| accepted

Answered
Why do we need a File Installation Key?
Good question. I wonder that too. But I think it is probably one of the multiple layers of protection that the Mathworks wants t...

4 years ago | 0

Answered
How to transfer an M-file to a Smulink block
Use the "MATLAB Function" block

4 years ago | 0

Answered
Extract data from simulink to excel
blocks=find_system('Model/System','FindAll','On','SearchDepth','0', 'BlockType','Inport'); get(blocks,'Name')

4 years ago | 0

Answered
why wrapping with anonymous function speeds up?
Don't know the exact reason, but I guess it shows that "annonymous function handle" is faster than "named function handle". It i...

4 years ago | 0

Answered
How can you save a plot without generating the figure pop up?
f=figure('visible','off') and then do plot and save. Remember to close and delete f

4 years ago | 1

| accepted

Answered
Initialize Global Variable in Simulink
In your MATLAB Function block editor, click "Edit Data" icon on the tool strip, add "Gear" as a data. In the Simulink model, ad...

4 years ago | 0

| accepted

Answered
Reading files in a specified order
>> sort({'A11_K25-2.txt','A11_K27-1.txt','A11_K25-1.txt'}) ans = 1×3 cell array {'A11_K25-1.txt'} {'A11_K25-2.txt'} ...

4 years ago | 0

Answered
Trouble accessing and printing the parameters from a Bus in a MATLAB Script
function write_list(busObject) fileID = fopen('list.m', 'w'); ElementNames={busObject.Elements.Name}; fprintf(fileID, '%s\n',...

4 years ago | 0

| accepted

Answered
Check if object's property is empty
Might this help? >> EmptyRoot=xmlcomp.Edits('') EmptyRoot = Edits with no properties. >> isequal(root,EmptyRoot) ans = lo...

4 years ago | 4

Answered
Change properties of multiple components programmatically
Yes. Simpliest example a=uibutton; b=uibutton; set([a,b],'BackgroundColor','green')

4 years ago | 0

| accepted

Answered
'Execution of script contour as a function is not supported'
You must have a contour.m in the path that is shadowing the built-in function contour(). run which -all contour

4 years ago | 0

Answered
Function block works in 2017b but not in 2019b
Put a breakpoint in the code above and debug, the problem is clear. The "parent" of your "gcs" is the root level model, which c...

4 years ago | 0

| accepted

Answered
Simulink: determine if Signals are shown as propagated
open_system('f14'); lh=get_param('f14/Controller','linehandles') get(lh.Inport(1),'Name') get(lh.Inport(1),'SignalPropagation...

4 years ago | 0

Answered
Convert portion of matrix under the diagonal to column vector
Golfing... watch for any "holes" under the diagnal line nonzeros(tril(A,-1)')

4 years ago | 1

Load more