What is a model?

Professional Interests: Model-Based Development

Answered

join cell arrays together

x=repmat({'the_output'},5,1); y=mat2cell((1:5)',ones(5,1),1); z=cellfun(@(a,b) [a,num2str(b)],x,y,'UniformOutput',false)

join cell arrays together

x=repmat({'the_output'},5,1); y=mat2cell((1:5)',ones(5,1),1); z=cellfun(@(a,b) [a,num2str(b)],x,y,'UniformOutput',false)

alrededor de 3 horas ago | 1

Answered

Simulink : Get handle of a Matlab-Function block, inside Matlab-Function itself

I would think so, just try handle=get_param(Block,'handle') where "Block" is the full path of the MATLAB function block in your ...

Simulink : Get handle of a Matlab-Function block, inside Matlab-Function itself

I would think so, just try handle=get_param(Block,'handle') where "Block" is the full path of the MATLAB function block in your ...

alrededor de 7 horas ago | 0

Answered

How to build x and y coordinates using a For loop

maybe it should be y=zeros(12,2) x(i,:)=[x1(i),x2(i)]; y(i,:)=[y1(i),y2(i)];

How to build x and y coordinates using a For loop

maybe it should be y=zeros(12,2) x(i,:)=[x1(i),x2(i)]; y(i,:)=[y1(i),y2(i)];

alrededor de 7 horas ago | 0

| accepted

Answered

Simulink object... ...was changed during simulation

I had a user who had problem matching this although Simulink (earlier version) didn't give this exact error message. There is a...

Simulink object... ...was changed during simulation

I had a user who had problem matching this although Simulink (earlier version) didn't give this exact error message. There is a...

alrededor de 11 horas ago | 0

Answered

If statement not executing

Most likely a "floating point data equal comparison" issue. see (1/3)==(1-2/3). They are not equal if you run it in MATLAB.

If statement not executing

Most likely a "floating point data equal comparison" issue. see (1/3)==(1-2/3). They are not equal if you run it in MATLAB.

1 día ago | 0

Answered

robotics system toolbox example issue

Do you have the toolbox? What do you get from "ver robotics"

robotics system toolbox example issue

Do you have the toolbox? What do you get from "ver robotics"

2 días ago | 0

Answered

OK ... simple question! In newer versions of Simulink, I'm finding that I can't emphasize a line grouping (vectors, whatever) then move them with either the mouse of arrows.

Include at least one block in your group (selection), cut or copy, then paste, you can still move around the whole group.

OK ... simple question! In newer versions of Simulink, I'm finding that I can't emphasize a line grouping (vectors, whatever) then move them with either the mouse of arrows.

Include at least one block in your group (selection), cut or copy, then paste, you can still move around the whole group.

3 días ago | 0

Answered

Matlab borrow products for simulink code generation

Go through your tasks when there is an internet connection, then run license('inuse') to find out what are needed. You may also ...

Matlab borrow products for simulink code generation

Go through your tasks when there is an internet connection, then run license('inuse') to find out what are needed. You may also ...

3 días ago | 0

Answered

getting data from structure

temp=[S.speed]; out=temp(1:3:end) % or get all three speeds Speed=reshape([S.speed],3,[])

getting data from structure

temp=[S.speed]; out=temp(1:3:end) % or get all three speeds Speed=reshape([S.speed],3,[])

6 días ago | 0

Answered

using the data from struct

If you can't change the other program, Out=YourOtherProgram(), where "Out" is a data like "ans" in your picture, then you can u...

using the data from struct

If you can't change the other program, Out=YourOtherProgram(), where "Out" is a data like "ans" in your picture, then you can u...

6 días ago | 0

| accepted

Answered

SIL using model reference

I thought the document was clear. To deploy the generated code as part of a larger application that uses the referenced model, ...

SIL using model reference

I thought the document was clear. To deploy the generated code as part of a larger application that uses the referenced model, ...

6 días ago | 0

| accepted

Answered

A is a matrix of size 32*32.I want to subtract elements of each 4*4 block of A from their respective 4*4 means

A=rand(32); out = blockproc(A,[4 4],@(x)mean(x.data(:))); temp=repmat({ones(4,1)},8,1); temp=blkdiag(temp{:}); Result=A-te...

A is a matrix of size 32*32.I want to subtract elements of each 4*4 block of A from their respective 4*4 means

A=rand(32); out = blockproc(A,[4 4],@(x)mean(x.data(:))); temp=repmat({ones(4,1)},8,1); temp=blkdiag(temp{:}); Result=A-te...

8 días ago | 0

Answered

How to prevent stateflow from opening the system?

Maybe, it is dependent on how you program it? The following example doesn't show the model until the last line. bdclose all; n...

How to prevent stateflow from opening the system?

Maybe, it is dependent on how you program it? The following example doesn't show the model until the last line. bdclose all; n...

8 días ago | 0

Answered

What kind of source block is this?

double click to open it. The title of the dialog window shall tell the block type.

What kind of source block is this?

double click to open it. The title of the dialog window shall tell the block type.

10 días ago | 0

Answered

How to Model For loop as Simulink Model?

Use "For Iterator Subsystem"

How to Model For loop as Simulink Model?

Use "For Iterator Subsystem"

12 días ago | 0

| accepted

Answered

Why wont this run? "Array indices must be positive integers or logical values."

Most likely typo f = (1/(2*(pi)))*(L*C*(((R1^2)*C-L)/((R2^2)*C-L)))^(1/2)

Why wont this run? "Array indices must be positive integers or logical values."

Most likely typo f = (1/(2*(pi)))*(L*C*(((R1^2)*C-L)/((R2^2)*C-L)))^(1/2)

15 días ago | 0

Answered

How do I define and use a standard range written by variable

N=10; % provide a reasonable number based on the range of input data n=1:N; LowBound=690*n; HighBound=1200*n; InputData=[...

How do I define and use a standard range written by variable

N=10; % provide a reasonable number based on the range of input data n=1:N; LowBound=690*n; HighBound=1200*n; InputData=[...

16 días ago | 0

Answered

Simulink sample time error

The error has nothing to do with the script. According to the error message, your simulation step size is fixed, 1 second. Howev...

Simulink sample time error

The error has nothing to do with the script. According to the error message, your simulation step size is fixed, 1 second. Howev...

17 días ago | 0

Answered

Calculating that power supply won't burn my laptop

Modern power supplier/charger are all "smart" devices. The power/volt/max current numbers are not derived directly from the simp...

Calculating that power supply won't burn my laptop

Modern power supplier/charger are all "smart" devices. The power/volt/max current numbers are not derived directly from the simp...

21 días ago | 0

Answered

Cannot get points on a plot to show

You are plotting one point at a time, use plot(N,error(N),'+') or at the end, plot(1:10,error)

Cannot get points on a plot to show

You are plotting one point at a time, use plot(N,error(N),'+') or at the end, plot(1:10,error)

22 días ago | 0

| accepted

Answered

Help with restricting input

Suprisingly, just run your specification and it works in MATLAB number=input('Enter a whole number between 1 and 100:') while ...

Help with restricting input

Suprisingly, just run your specification and it works in MATLAB number=input('Enter a whole number between 1 and 100:') while ...

22 días ago | 0

| accepted

Answered

Index Exceeds the number of array elements (993268)

If you have an array with 10 elements but you are trying to access the 11th element, you got this error. Just step through your ...

Index Exceeds the number of array elements (993268)

If you have an array with 10 elements but you are trying to access the 11th element, you got this error. Just step through your ...

22 días ago | 0

| accepted

Answered

how can I compute distances:

Run the code and then run "license inuse". Only MATLAB is needed.

how can I compute distances:

Run the code and then run "license inuse". Only MATLAB is needed.

24 días ago | 0

Answered

I want to generate a time vector

datetime([0,0,0,6,30,0]):minutes(5.12):datetime([0,0,0,15,0,0])

I want to generate a time vector

datetime([0,0,0,6,30,0]):minutes(5.12):datetime([0,0,0,15,0,0])

27 días ago | 0

Answered

How do I programmatically set the parameters of a Simulink-PS Converter?

Click one such block in your model and run "get(gcbh)" in Command Window to learn about its properties and values. You could do...

How do I programmatically set the parameters of a Simulink-PS Converter?

Click one such block in your model and run "get(gcbh)" in Command Window to learn about its properties and values. You could do...

27 días ago | 1

| accepted

Answered

Drawing Rectangle/Lines with data

rectangle('Position',[0 0.15 0.012 0.012]) axis([0 0.02 0 0.2])

Drawing Rectangle/Lines with data

rectangle('Position',[0 0.15 0.012 0.012]) axis([0 0.02 0 0.2])

29 días ago | 0

| accepted