Réponse apportée
'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

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

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

plus de 4 ans il y a | 1

Réponse apportée
Please answer, How to fix 5.4 MISRA-C 2012 Polyspace Warning?
"int16_t i;" is declared in both the inner and outer scope. Most likely, it is a piece of inexperienced code. Use a different v...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How can I add only a certain amount of instances of a custom library block to my model?
It can be implemented through the "copyfcn" callback of the library block. This function callback is executed every time the lib...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Cannot upgrade MATLAB from 2021a to 2021b.
This "Update" refers to the small patches or bug fixes in the same release, in your example, Release 2021a. Install R2021b sepa...

plus de 4 ans il y a | 0

Réponse apportée
Model command with vector / matrix inputs
Certainly the needed input vector can be constructed based on whatever data you have. But consider using the sim() command. It m...

plus de 4 ans il y a | 0

Réponse apportée
How to replace for loop ?
This is not really a "vectorization" problem. "Vectorization" refers to performing a task on a vector as a whole, rather than pe...

plus de 4 ans il y a | 1

Réponse apportée
Count unique values in a double
count = numel(unique(x(:,1)))

plus de 4 ans il y a | 0

Réponse apportée
Error in Simulink function block code: Index expression out of bounds. Attempted to access element 2. The valid range is 1-1.
You probably didn't define A1 in the Model Explorer or the Data Editor for the MATLAB function. So it took the first assignment ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How do I save a figure to a different directory with a specific figure name?
savefig(FILENAME) saves the current figure to a file named FILENAME savefig(H, FILENAME) saves the figures identified b...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How can I randomly select one variable between 3 variables?
a = [10:10:30] a(randi(3,1))

plus de 4 ans il y a | 2

| A accepté

Réponse apportée
How to pad a matrix with zeros while preserving indexing?
a=[1:285;zeros(1,285)]'; b=[44 56379 57 72901 64 82025 79 101357 88 112148 96 122019 103 130476 ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
What is the difference b/n sum and add block in the Simulink library?
They are the same type of block (blocktype: Sum). Double click the Sum block, select "Rectangular" and set "list of sign" to be ...

plus de 4 ans il y a | 0

Réponse apportée
how to load parameter using open_system()
open_system() only opens the Simulink model. It won't load parameters. However, the Simulink model itself might have setup to l...

plus de 4 ans il y a | 0

Réponse apportée
Assign Port name "Data Type" from Command Window
Try it on one block, get and set the data type get_param('ModelName/InportName','OutDataTypeStr') set_param('ModelName/InportN...

plus de 4 ans il y a | 1

Réponse apportée
A new block named 'data1' cannot be added
Most likely it is because a block with the same name already exists. Use the 'MakeNameUnique', 'on' option. [sys, char(data(i))...

plus de 4 ans il y a | 0

Réponse apportée
How to pass commandline arguments to external text editor?
You need to run system("C:\Program Files\Emacs\x86_64\bin\emacsclientw.exe -n -c -a") or add this line to your own edit.m file

plus de 4 ans il y a | 0

Réponse apportée
How do you implement a matlab function in simulink which calls other functions to achieve its outputs.
As long as the M-files for those "other functions" are in the MATLAB path, The "MATLAB Function block" in your Simulink model sh...

plus de 4 ans il y a | 0

Réponse apportée
How to add path to block From multimedia file, from Matlab workspace
To assign the value of "fullname" to a variable called 'file' in the base workspace, it needs to be: assignin('base','file',ful...

plus de 4 ans il y a | 0

Réponse apportée
How to fill a matrix of known size with data from a row vector
reshape()

plus de 4 ans il y a | 2

Réponse apportée
Anti-lock braking Simulink -friction coefficient
Based on the mu-slip curve, it is most likely a dry asphalt surface. sldemo_absdata sldemo_absbrake plot(slip,mu)

plus de 4 ans il y a | 0

Réponse apportée
How to plot a point, if it lies within a cube?
For boundary, use plot3() to plot the lines between the 8 tip points of the cube. To check if a point is within the boundary, y...

plus de 4 ans il y a | 0

Réponse apportée
Get the port handle for the reference mode
I would think that you porbably need to follow the Model block, open the referenced model and then get the input and output port...

plus de 4 ans il y a | 0

Réponse apportée
Hold a plot other than the most recent
Look at the examples. https://www.mathworks.com/help/matlab/ref/hold.html?searchHighlight=hold&s_tid=srchtitle_hold_1

plus de 4 ans il y a | 0

Réponse apportée
Rectangular pulse coming as trapezoid
This is normal. The ideal perfect rectangular pulse requires two values (1 and 3) at the exact same time (e.g. t=0.2895). The ou...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to create an impulse when the value of a signal changes?
"Detect Change" block Enabled or triggered subsystem block Pulse Generator block

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How can I check if a cell array contains multiple strings without loops ?
>> cell2mat(regexp(FileNames,'S0A|S0B|S0C')) ans = 13 13 13 13 13 13

plus de 4 ans il y a | 0

Réponse apportée
Finding the endpoint (tip) in a figure
It looks like the figure is created by using stem(). If you created the figure, won't you have the data for the "red dot" alread...

plus de 4 ans il y a | 0

| A accepté

Charger plus