Question

How to show the Unit parameter in the signal attrbutes of a constant block?

For the attached Simulink model I created using MATLAB R2021a, how can I show the Unit parameter in the block parameters of the ...

13 dagar ago | 1 answer | 0

Answered

To change Current Folder to the folder of .m File

For live scripts, @Qi Wang suggested using this: fileparts(matlab.desktop.editor.getActiveFilename) to get the full path of t...

To change Current Folder to the folder of .m File

For live scripts, @Qi Wang suggested using this: fileparts(matlab.desktop.editor.getActiveFilename) to get the full path of t...

29 dagar ago | 0

Answered

ode45 goes busy endlessly when using the sign of a state variable

Thanks to the explanation of Star Strider, the use of sign() can be replaced by fr*Mass*9.8)*(y(2)>0) to make it work.

ode45 goes busy endlessly when using the sign of a state variable

Thanks to the explanation of Star Strider, the use of sign() can be replaced by fr*Mass*9.8)*(y(2)>0) to make it work.

ungefär 2 månader ago | 0

| accepted

Question

ode45 goes busy endlessly when using the sign of a state variable

This term "- fr*Mass*9.8*sign(y(2))" makes ode45 busy forever specifically when using 'sign(y(2))' I just need to make -fr*Mass...

ungefär 2 månader ago | 2 answers | 0

Question

Changing the same property of some axis children using subsasgn

How to make the following code work in order to change the 'Visible' property of some children plots whose handles are stored in...

ungefär 2 månader ago | 1 answer | 0

Answered

How to write code in MATLAB?

Your code in the question is not clear to me, nevertheless, my code below can be edited to fulfil your needs. x = 1:10; % array...

How to write code in MATLAB?

Your code in the question is not clear to me, nevertheless, my code below can be edited to fulfil your needs. x = 1:10; % array...

4 månader ago | 0

Answered

Working a definite integral

Read this Definite Integrals of Symbolic Expressions, then you can do syms x vpaintegral(1/sqrt(1-x^2)*(x^2+1.1202*x+0.2132),[...

Working a definite integral

Read this Definite Integrals of Symbolic Expressions, then you can do syms x vpaintegral(1/sqrt(1-x^2)*(x^2+1.1202*x+0.2132),[...

5 månader ago | 1

| accepted

Question

How to solve a set of symbolic equations for the same variable?

Is there a way to make the following work and solve the following set of symbolic equations for the same variable and save the o...

5 månader ago | 1 answer | 0

Question

MeshDensity: How to exactly set the number of evaluation points of fplot?

In the documentation, it is said under 'MeshDensity' option of 'fplot': "Number of evaluation points, specified as a number. T...

5 månader ago | 1 answer | 0

Question

'deal' doesn't distribute the elements of a calculated array out of cellfun

For the following syms syma symb eqns = [... syma*exp(symb)== 1,... syma*exp(symb*1500) == 5,... ]; vars = [s...

7 månader ago | 1 answer | 0

Answered

How do I skip items in a legend?

You can simply delete the last undesired entry by the following: % assume you plotted some curves before this line and all of t...

How do I skip items in a legend?

You can simply delete the last undesired entry by the following: % assume you plotted some curves before this line and all of t...

7 månader ago | 1

Answered

autorename if saved file already exist

Revisitng this old question, I followed the idea of Jan to come up with this solution of appending the existent file name with a...

autorename if saved file already exist

Revisitng this old question, I followed the idea of Jan to come up with this solution of appending the existent file name with a...

9 månader ago | 1

Question

Is it possible to have an inline function inside a cell array to conditionally return an element to be stored?

Consider I have mycondition = true; truestatement = 'yes'; % returned by the inline function when mycondition is true falsest...

9 månader ago | 2 answers | 0

Answered

How to selectively save the names and values of some workspace variables to a CSV file?

Thanks to the inspiring answer of @Rik, I found the following solution without the need to use for loop a = 3; b=7; c=5; d=9; ...

How to selectively save the names and values of some workspace variables to a CSV file?

Thanks to the inspiring answer of @Rik, I found the following solution without the need to use for loop a = 3; b=7; c=5; d=9; ...

9 månader ago | 0

Question

How to selectively save the names and values of some workspace variables to a CSV file?

Consider the following a = 3; b=7; c=5; d=9; save('test.mat') data = load('test.mat'); toSave = { 'b' ; 'c' }; writece...

9 månader ago | 2 answers | 0

Question

Write to an already opened Excel file

The following MATLAB code works well for writing eActiveSheetRange.Value to the range eActiveSheetRange However, I have t...

10 månader ago | 1 answer | 0

Question

Live scripts stored in MATLAB Drive are assumed to be located in Temp folder

I have MATLAB R2019a on Win10 and MATLAB Drive Connector. Some live scripts are stored in the local MATLAB Drive folder. Howeve...

mer än ett år ago | 1 answer | 0

Question

Reshaping Nodal Spatial Vectors into 3D Matrices for Countourslice

I have a problem of temperature field across a cubic domain. My nodes locations are stored in 3 column vectors of *x=[x1 x2 ....

mer än 6 år ago | 0 answers | 0