What is a model?

Professional Interests: Model-Based Development

Answered

Apply function with multiple input variables to table entry

function_handle might be what you need.

Apply function with multiple input variables to table entry

function_handle might be what you need.

circa un'ora ago | 0

Answered

In a single line, create a handle to the " +" function.

h=@plus; h(1,2)

In a single line, create a handle to the " +" function.

h=@plus; h(1,2)

circa 19 ore ago | 2

| accepted

Answered

How to choose a random coordinate (location like i,j) in a matrix

[m,n]=size(A); i=randi([1 m]); j=randi([1 n])

How to choose a random coordinate (location like i,j) in a matrix

[m,n]=size(A); i=randi([1 m]); j=randi([1 n])

circa 19 ore ago | 0

Answered

Stripping outputs from dir function

fileList = dir('*.png')

Stripping outputs from dir function

fileList = dir('*.png')

circa 20 ore ago | 0

| accepted

Answered

matlab space error problem

From "help strcat" For character array inputs, strcat removes trailing ASCII white-space characters: space, tab, verti...

matlab space error problem

From "help strcat" For character array inputs, strcat removes trailing ASCII white-space characters: space, tab, verti...

circa 20 ore ago | 0

Answered

Sizing in subplot()

subplot(3,2,x) gives you 3 rows and 2 columns thus 6 subplots. x can be 1,2,...6

Sizing in subplot()

subplot(3,2,x) gives you 3 rows and 2 columns thus 6 subplots. x can be 1,2,...6

circa 20 ore ago | 0

| accepted

Answered

How to recall a figure which was generated by a name "fname = figure; figure(fname)" without saving it ?

When you run fpressure=figure, it creates the figure object handle fpressure. But after you clear the workspace, the figure obje...

How to recall a figure which was generated by a name "fname = figure; figure(fname)" without saving it ?

When you run fpressure=figure, it creates the figure object handle fpressure. But after you clear the workspace, the figure obje...

circa 22 ore ago | 0

Answered

Increasing value of each row from matrix A to create Matrix B, then replace 21 into 1 while the rest into 0 to create Matrix C

B=A+(1:31); index=B==21; B(index)=1; B(~index)=0

Increasing value of each row from matrix A to create Matrix B, then replace 21 into 1 while the rest into 0 to create Matrix C

B=A+(1:31); index=B==21; B(index)=1; B(~index)=0

circa 23 ore ago | 0

Answered

Removing NaN in all the columns from matrix A to produce matrix B

index=any(isnan(A)); B=A(:,~index)

Removing NaN in all the columns from matrix A to produce matrix B

index=any(isnan(A)); B=A(:,~index)

circa 24 ore ago | 0

| accepted

Answered

Simulink filtering of a table

The straightforward way to do this is to use "n-D Lookup Table". You have a 5-D lookup table here. The first 5 columns are the l...

Simulink filtering of a table

The straightforward way to do this is to use "n-D Lookup Table". You have a 5-D lookup table here. The first 5 columns are the l...

1 giorno ago | 0

Answered

How to store dynamically an array in a For iterator Simulink Subsystem

I know this might be a simple example behind your real need. But this is unnecessary. The for-loop can be implemented inside th...

How to store dynamically an array in a For iterator Simulink Subsystem

I know this might be a simple example behind your real need. But this is unnecessary. The for-loop can be implemented inside th...

1 giorno ago | 0

Answered

Issue with the variable after exiting for loop

Yes. before the loop abc_p=zeros(length (ring_vec), length (opcon_vec), length (rccorner_vec) ,....), matching the size in...

Issue with the variable after exiting for loop

Yes. before the loop abc_p=zeros(length (ring_vec), length (opcon_vec), length (rccorner_vec) ,....), matching the size in...

1 giorno ago | 0

| accepted

Answered

Set lower than 0.1 values to zero in tables that stored in a cell

In general, this is how you do it. Apply it to a table inside a cell should not be that difficult. a=rand(3,5); index=a<0.5; ...

Set lower than 0.1 values to zero in tables that stored in a cell

In general, this is how you do it. Apply it to a table inside a cell should not be that difficult. a=rand(3,5); index=a<0.5; ...

1 giorno ago | 1

| accepted

Answered

system command pressing return

This trick has worked many times. Try it. Create a text file called KeyInput.txt, in which you hit return twice and save it. Ba...

system command pressing return

This trick has worked many times. Try it. Create a text file called KeyInput.txt, in which you hit return twice and save it. Ba...

1 giorno ago | 0

| accepted

Answered

ressistors with small random offset in SIMULINK

This "Variable Resistor" is not the right one to use. This "Variable Resistor" represents a physical variable resistor in the la...

ressistors with small random offset in SIMULINK

This "Variable Resistor" is not the right one to use. This "Variable Resistor" represents a physical variable resistor in the la...

2 giorni ago | 0

Answered

isempty is allways zero

zero and empty are different isempty([]) isempty(0) isempty('')

isempty is allways zero

zero and empty are different isempty([]) isempty(0) isempty('')

2 giorni ago | 0

| accepted

Answered

Eliminate certain entries of cell array

Would it possible to make it array? a=1:5; b=1:3; a=setdiff(a,b)

Eliminate certain entries of cell array

Would it possible to make it array? a=1:5; b=1:3; a=setdiff(a,b)

2 giorni ago | 0

Answered

Stop Simulink simulation when reached an oscillating steady state amplitude

If you have this toolbox and can use this block, maybe you can look at the rate of change of the magnitude. Sinusoidal Measurem...

Stop Simulink simulation when reached an oscillating steady state amplitude

If you have this toolbox and can use this block, maybe you can look at the rate of change of the magnitude. Sinusoidal Measurem...

2 giorni ago | 0

Answered

How to run a Simulink simulation using keyboard

Ctrl+T Keyboard and Mouse Actions for Simulink Modeling

How to run a Simulink simulation using keyboard

Ctrl+T Keyboard and Mouse Actions for Simulink Modeling

2 giorni ago | 0

| accepted

Answered

Taking element of matrix from state space model of plant

Use the DeMux or BusSelector block

Taking element of matrix from state space model of plant

Use the DeMux or BusSelector block

2 giorni ago | 0

Answered

can a new function be defined in the middle of livescript?

No. %% a=1; function out=timestwo(in) out=in*2; end b=timestwo(a) Error: File: Untitled Line: 8 Column: 1 Function d...

can a new function be defined in the middle of livescript?

No. %% a=1; function out=timestwo(in) out=in*2; end b=timestwo(a) Error: File: Untitled Line: 8 Column: 1 Function d...

3 giorni ago | 0

| accepted

Answered

Problem with the use of find(diff...>1))

just run diff(Xr) first and you will see why

Problem with the use of find(diff...>1))

just run diff(Xr) first and you will see why

3 giorni ago | 0

| accepted

Answered

How can I delete a particular element in a set of workspace variables?

For a one-time processing, you can do this for r = 1:length(C) if C(r).size(1)>839 str=sprintf('%s(840:end)=[];',...

How can I delete a particular element in a set of workspace variables?

For a one-time processing, you can do this for r = 1:length(C) if C(r).size(1)>839 str=sprintf('%s(840:end)=[];',...

3 giorni ago | 0

Answered

how to make the sum of all centroids?

Feed your "Centroid" signal to a "Sum" block, connect the output of "Sum" to a "Unit Delay" block, connect the output of "Unit D...

how to make the sum of all centroids?

Feed your "Centroid" signal to a "Sum" block, connect the output of "Sum" to a "Unit Delay" block, connect the output of "Unit D...

3 giorni ago | 1

| accepted

Answered

How do I rerun a Simulink model?

In general, most Simulink blocks support vector and array input. For example, the multiply (Product) block supports element-wise...

How do I rerun a Simulink model?

In general, most Simulink blocks support vector and array input. For example, the multiply (Product) block supports element-wise...

3 giorni ago | 0

| accepted

Answered

save a fprintf as text file

fid=fopen('MyTextFile.txt','wt'); fprintf(fid,...); fclose(fid);

save a fprintf as text file

fid=fopen('MyTextFile.txt','wt'); fprintf(fid,...); fclose(fid);

5 giorni ago | 0

| accepted

Answered

Saturating Functions at a certain value

x=[0:0.01:20]; expo=@(x) min(2.^x,100); plot(x,expo(x));

Saturating Functions at a certain value

x=[0:0.01:20]; expo=@(x) min(2.^x,100); plot(x,expo(x));

7 giorni ago | 0

Answered

Is it possible to create a library of Model Reference blocks?

It is possible but based on what you described, I would say a library of subsystem blocks are better than a library of model ref...

Is it possible to create a library of Model Reference blocks?

It is possible but based on what you described, I would say a library of subsystem blocks are better than a library of model ref...

7 giorni ago | 0

Answered

How to create a block diagram that will increment a value?

A counter block, multiplied by 0.1 or -0.1

How to create a block diagram that will increment a value?

A counter block, multiplied by 0.1 or -0.1

7 giorni ago | 0

| accepted

Answered

how to get simulink stop time even if using code generation

Not sure what you mean. >> vdp >> get_param('vdp','StopTime') ans = '20'

how to get simulink stop time even if using code generation

Not sure what you mean. >> vdp >> get_param('vdp','StopTime') ans = '20'

8 giorni ago | 0