Respondida
Import Matlab matrix to Simulink
See this link and open the "Read 2-D Signal" example https://www.mathworks.com/help/releases/R2020b/simulink/slref/fromworkspac...

más de 5 años hace | 1

| aceptada

Respondida
How can I determine if a value is in the interval?
if and(value>array(1), value<array(end)) display('inside'); else display('outside') end

más de 5 años hace | 2

Respondida
How do I get index matrix for matrix of values?
>> [Row,Column]=ind2sub([3,3],1:9) Row = 1 2 3 1 2 3 1 2 3 Column = 1 1 1 ...

más de 5 años hace | 1

Respondida
How to delete empty files/spreadsheets in a directory ?
run [STATUS,SHEETS] = xlsfinfo(FILENAME). Most likely, it will tell you there is only one sheet run [NUM,TXT,RAW]=xlsread(FILEN...

más de 5 años hace | 0

Respondida
How to use external simulation time in simulink?
USE "XY Graph" block. X is the received time, Y is the received data.

más de 5 años hace | 0

Respondida
how to sum vector with simulink sum block
Just use the good old Sum block. Give one Constant block, specify value as [1 2 3] and another Constant block [10 20 33], Sum to...

más de 5 años hace | 0

| aceptada

Respondida
Access programmatically to EnumTypeDefinition in Simulink Data Dictionary
out=getValue(enumerationType) info=out.Enumerals info.Name

más de 5 años hace | 1

| aceptada

Respondida
Is there a command to close all the tabs?
Starting from gcs, you can do this. The tab for the root level model would be kept open. The tabs for other models are also not ...

más de 5 años hace | 0

| aceptada

Respondida
Sum subarrays of a Matrix.
One-liner transpose(reshape(sum(reshape(A',3,[])),3,[])) Or transpose(cell2mat(cellfun(@sum,mat2cell(A',[3,3,3],3),'unif',0))...

más de 5 años hace | 1

| aceptada

Respondida
Struct contents reference from a non-struct array object.
In your code, variable "filename" is a string. It does not have the structure field ".name". If your code looks like this, then...

más de 5 años hace | 1

Respondida
Simulink Clock (time) reset?
Feed Constant value 1 to an integrator, the output is the time. Wrap the state of the Integrator to 5400 and 0.

más de 5 años hace | 0

Respondida
Searching structure that has all caps field names with list that varies in case.
for iVar=1:numel(myVars) b_sp = b_struct.dArray.(upper(myVars{iVar})); end

más de 5 años hace | 1

Respondida
combine matrix in matlab
reshape([A;B],1,[])

más de 5 años hace | 0

| aceptada

Respondida
Variables scope in MatLab function block
Use "Edit Data" in the MATLAB Function Editor to specify those base workspace variables as the parameters

más de 5 años hace | 0

| aceptada

Respondida
Naming Excel Sheet with xlswrite.
FileName=['Rule',num2str(x)] FileName=sprintf('Rule%d',x)

más de 5 años hace | 1

| aceptada

Respondida
Why, when doing a for loop to form a column from an array, does it give me 0 values except for the last element?
most likely, change to Lo(I+3*(Q-1),1)=IncECEF(Q,I) And do you know this? A=magic(5); B=A' C=B(:)

más de 5 años hace | 1

| aceptada

Respondida
How to plot two arrays which different time stamps and lengths in one plot?
%% A=[0.1 0.2 0.35 0.42]; B=[1 4 9 12]; C=[0.01 0.4 0.5 0.8 1 2 10]; D=[5 7 10 11 12 3 1]; [x,index]=sort([A,C]); y=[B,D...

más de 5 años hace | 0

Respondida
How to update new annotations or descriptions done in a library subsystem into the model where the library is used
To be clear, the annotation needs to be inside a subsystem block in the library. Then after you updated the annotation in the li...

más de 5 años hace | 0

Respondida
issues connecting my from workshop block to the PSS and SPS Converter block
In your diagram with error red line, on the top left, you need a Simulink to Physical System converter, not Physical System to S...

más de 5 años hace | 0

| aceptada

Respondida
How to plot two different 3D graphics together?
The command "figure" creates a new figure. Use just one of them, and run "hold on".

más de 5 años hace | 0

| aceptada

Respondida
How many Workspace's we have in MATLAB ?
Another common one is the function workspace, which is created when the function is entered and destroyed when the function is e...

más de 5 años hace | 0

Respondida
extracting values from a matrix or vector
b=a([2,5]), second and fifth element

más de 5 años hace | 2

| aceptada

Respondida
If statements comparing two character strings with multiple inputs
variable 'str1' and 'str2' are supposed to take values from function input arguments when you call h20_props(50,"nu","SI"). But ...

más de 5 años hace | 0

| aceptada

Respondida
How to get the string form of an anonymous function?
f = @(x) exp(-0.5*x); >> func2str(f) ans = '@(x)exp(-0.5*x)' Or, provide your string, use str2func()

más de 5 años hace | 1

| aceptada

Respondida
How to determine the moment (time) at which the signal exceeded the set value in simulink?
Assume you build your model correctly, your signal varies as time goes. Compare your signal with the Constant value, its output ...

más de 5 años hace | 0

Respondida
How to change Simulink model line thikness
No. You can't. Simulink is a graphical modeling tool, but not a graph tool. Use something else such as Visio, or Shapes in MS Of...

más de 5 años hace | 0

| aceptada

Respondida
Add one port to a Simulink block, from command line AND automaticaly keep the same distance between ports
I dealt with this problem before. There is no quick or automatic way but the following method worked for me to keep the existing...

más de 5 años hace | 0

| aceptada

Respondida
Operator '==' is not supported for operands of type 'tf'
The reason: When you click "cancel" in the inputdlg(), your variable "tf" is not evaluated. When the second part of the code i...

más de 5 años hace | 0

| aceptada

Respondida
why do i get the error 'undefined function or variable ' for simin from workspace
When you use "From Workspace" block, it expects the variable "simin" exists in the base workspace. Create that variable to elimi...

más de 5 años hace | 0

| aceptada

Respondida
Transform a matrix in a special way
B=zeros(5); B(tril(true(5),-1))=A B=B'

más de 5 años hace | 1

Cargar más