Respondida
How to convert a char array field in a struct array to a string field in a vectorized fashion.
It can be done but not sure if it is more efficient than the simple for-loop myArray=struct('code',{'a','ab','abc'}) myString=...

casi 5 años hace | 0

Respondida
Error when loading external input data into root-level Inport
Simulink model simulation has a "time" element. The true meaning of your data is that you want to input 2 scalar data. The numbe...

casi 5 años hace | 0

| aceptada

Respondida
Matlab R2021b not generating output from Simulink
Assume "simout" is the name used in the "To Workspace" block, the saving format "Array" need to be set at the "To Workspace" blo...

casi 5 años hace | 0

Respondida
Error in port widths or dimensions. 'Output Port 1' and Error in port widths or dimensions. Invalid dimension has been specified for 'Input Port 5'
Clicking the link in the error message would lead to the block in the Simulink model. Double click the two port blocks to check ...

casi 5 años hace | 0

Respondida
What can I do so that a "matlab function" block can read the variables defined in a .m file
In the MATLAB Function block editor, click "Edit data", add "Aq11" as a "parameter".

casi 5 años hace | 0

Respondida
Checking the exisiting of the Goto block with specified GotoTag
find_system('ModelName','BlockType','Goto','GotoTag','Out4')

casi 5 años hace | 0

| aceptada

Respondida
How to add programmatically second input to Scope block in Simulink
specify 2 ports when you add the Scope block add_block('built-in/Scope','test/scope','NumInputPorts', '2');

casi 5 años hace | 1

Respondida
How to get Leftmost block position
Get the position data of all the blocks Find the Min x value Through index, find the block

casi 5 años hace | 0

| aceptada

Respondida
How do we import a custom image on MATLAB which are outside of preinstalled libraries?
a = imread("c:\mydocument\cameraman.tif")

casi 5 años hace | 1

| aceptada

Respondida
How do I find out what type of block a Simulink block is?
What is a "sim"? If you have a Simulink model, double click the block. The block type is usually shown at the dialog window. Cli...

casi 5 años hace | 0

Respondida
Why am I getting "Potential conflicting usages of identifier "FALSE": a parameter and Language Keywords"
You know 'false' is used by MATLAB as logical value for 0. I think 'FALSE' might be used by Stateflow or some customized definit...

casi 5 años hace | 0

Respondida
Random shuffle of vector elements
p=randperm(3); index=[1,1+p,5]; b=A(index);

casi 5 años hace | 1

Respondida
How do I fill a 1000*25 length vector with random, non-repetitive numbers from 1 to 1000000?
a=zeros(1000,25); a(:)=randperm(1000000, numel(a));

casi 5 años hace | 0

| aceptada

Respondida
How can I control multi-switches
Use Toggle Switch or other switch blocks from Simulink Dashboard to connect to your acutal Switch blocks inside your model.

casi 5 años hace | 0

| aceptada

Respondida
Invalid use of operator
There is a difference between operator "*" and ".*". But there is no such an operator as ".-" in MATLAB.

casi 5 años hace | 0

Respondida
Simulink Switch Outputs wrong data format
check the size/dimension of the Constant zero block, the "TriggerOUT" Outport block and the Switch block itself. Specify it as [...

casi 5 años hace | 1

| aceptada

Respondida
Error using arrayfun All of the input arguments must be of the same size and shape
no need to use arrayfun() for this. cellstr(dec2bin(sbox,4))

casi 5 años hace | 1

Respondida
How can I create a set of N diagnal matrices range from diag(1, 1, ... , 1) to diag(-1, -1, ... , -1) for testing purposes?
a=(dec2bin(15:-1:0)-48)*2-1; z=zeros(4,4,16); for k=1:16 z(:,:,k)=diag(a(k,:)); end

casi 5 años hace | 1

Respondida
Creating a pulse for thermal noise
clc,clear Hz = 10; Amp = 10; x = -10:0.01:10; % a pulse function f = @(xi,a,b) a*rectpuls(xi,b)-174; % plot to plot(x,f...

casi 5 años hace | 0

| aceptada

Respondida
How to convert 32x32x2x20000 into 20000x1 cell array?
mat2cell() ?

casi 5 años hace | 0

Respondida
Multiple plots not working on the simulink spring mass model
This one again? https://www.mathworks.com/matlabcentral/answers/646918-my-simulink-model-seems-to-not-receiving-proper-variable...

casi 5 años hace | 0

Respondida
Insert degree symbol in axis title.
title('9^oE') text(0.5,0.5,'9^oE') xticklabels({'0^oE','1^oE'}) doc title search for "superscript"

casi 5 años hace | 0

Respondida
Data type work vector name must less than 31 characters long
Assume you are using base workspace as data source, could run this in Command Window and inspect the "data type" property value?...

alrededor de 5 años hace | 0

Respondida
Creating a vector from a set of coordinates
You mean like this? There is really no need to do this. Please explain the need. x = [10.1, 5.4, 7.3]; y = [2.3, 7.4, 8.8]; i...

alrededor de 5 años hace | 0

Respondida
Replace loop with more efficient procedure to make it faster
Would this give you a clue? t1=1:3; t2=(1:4)'; flag=(t1==t2)

alrededor de 5 años hace | 1

| aceptada

Respondida
Can I save all the command history of a running script?
diary()?

alrededor de 5 años hace | 0

Respondida
MATLAB path linked to last user account for designated computer license installed on Windows 10 device
There is no problem with the installation. No one should modify the build-in pathdef.m. Instead, everyone should use a short-c...

alrededor de 5 años hace | 0

| aceptada

Respondida
How can I use or call .exe file in my normal matlab script ?
doc system

alrededor de 5 años hace | 0

Respondida
Unable to do Modeling simulink for MAB and JMAAB
Model Advisor, by products, Simulink, modeling standards, MAB It requires Simulink Check toolbox

alrededor de 5 años hace | 1

| aceptada

Respondida
How to make the value in Data Store Memory global
The example is here. https://www.mathworks.com/help/simulink/ug/using-global-data-with-the-matlab-function-block.html Most like...

alrededor de 5 años hace | 1

Cargar más