Answered

How do I restrict my data that needs to be plotted?

C = A(60,:); indices = C<40000; C_in_Range = C(indices); plot(C_in_Range) axis([200,300,0,40000])

How do I restrict my data that needs to be plotted?

C = A(60,:); indices = C<40000; C_in_Range = C(indices); plot(C_in_Range) axis([200,300,0,40000])

9 years ago | 0

Answered

Vary Variable name in a for loop

you can create a name with this: myvarname = cell(3,1); for j=1:3 myvarname{j} = sprintf('Trace_1_1_%u_1',j) end ...

Vary Variable name in a for loop

you can create a name with this: myvarname = cell(3,1); for j=1:3 myvarname{j} = sprintf('Trace_1_1_%u_1',j) end ...

9 years ago | 0

Answered

How to convert daily data to monthly?

Every 30 data rows, I would average them out and save it in 1 row.This way, 30 days shrinks down to 1 data (a month). Or another...

How to convert daily data to monthly?

Every 30 data rows, I would average them out and save it in 1 row.This way, 30 days shrinks down to 1 data (a month). Or another...

9 years ago | 0

Answered

using ssSetNumInputPorts but no change in inputports...

You need to command MEX thenameofyourCcode In MATLAB's command window, and then reopen the model to see the change.

using ssSetNumInputPorts but no change in inputports...

You need to command MEX thenameofyourCcode In MATLAB's command window, and then reopen the model to see the change.

9 years ago | 0

Answered

Simulink: combine real and complex signals

In Simulink there are blocks that handle complex numbers. Open the Simulink Library browser and in the search box on the top ...

Simulink: combine real and complex signals

In Simulink there are blocks that handle complex numbers. Open the Simulink Library browser and in the search box on the top ...

9 years ago | 0

Answered

Does ode45 hits events depending on the maxStep value?

As far as for a numerical ODE solver, i.e. ODE45, you can never get anything exact. Your solution is not exact and the events so...

Does ode45 hits events depending on the maxStep value?

As far as for a numerical ODE solver, i.e. ODE45, you can never get anything exact. Your solution is not exact and the events so...

9 years ago | 0

Answered

How to input and solve non-linear system of equations in a matrix form

Offcourse you cannot write a nonlinear equation in a matrix form. Matrix form is only possible for linear sets of equations....

How to input and solve non-linear system of equations in a matrix form

Offcourse you cannot write a nonlinear equation in a matrix form. Matrix form is only possible for linear sets of equations....

9 years ago | 0

Answered

How to open a file and store it in cell array?

YourFilePath = 'C:\My Documents\Myfolder1\myfile.txt'; fid = fopen(YourFilePath ,'w'); fprintf(fid,'whatever I want...

How to open a file and store it in cell array?

YourFilePath = 'C:\My Documents\Myfolder1\myfile.txt'; fid = fopen(YourFilePath ,'w'); fprintf(fid,'whatever I want...

9 years ago | 0

Answered

I'm trying to find if certain points are inside or outside a polygon

I think one should be able to easily do a simple inequality and find out of a point is outside or inside a closed curve. Here's...

I'm trying to find if certain points are inside or outside a polygon

I think one should be able to easily do a simple inequality and find out of a point is outside or inside a closed curve. Here's...

9 years ago | 0

Question

How to save a buffer from a tlc file and use it in another tlc file

In writing TLC files, I want to open a buffer and write stuff there and close it and use the buffer at another TLC file which wi...

9 years ago | 2 answers | 0

Answered

[simscape] how can I write a difference between output and input?

M = foundation.thermal.thermal; M is defined as an element of a structure. The structure names are fixed. I don't know if yo...

[simscape] how can I write a difference between output and input?

M = foundation.thermal.thermal; M is defined as an element of a structure. The structure names are fixed. I don't know if yo...

9 years ago | 0

Answered

Optimization using fmincon for a simulink model

My suggestion, move everything in MATLAB script language (m-files) if possible and don't do an optimization in Simulink. You can...

Optimization using fmincon for a simulink model

My suggestion, move everything in MATLAB script language (m-files) if possible and don't do an optimization in Simulink. You can...

9 years ago | 0

Answered

my matlab does not recognize the function sym. how can I solve this problem?

you need to purchase the Symbolic Math Toolbox. You probably don't have it. check syms x;

my matlab does not recognize the function sym. how can I solve this problem?

you need to purchase the Symbolic Math Toolbox. You probably don't have it. check syms x;

9 years ago | 0

| accepted

Answered

any application closing using matlab

You need to execute a dos command. Here's a piece of MATLAB's help: Please see the documentation on status = dos(command)...

any application closing using matlab

You need to execute a dos command. Here's a piece of MATLAB's help: Please see the documentation on status = dos(command)...

9 years ago | 0

Answered

How do you get Matlab to return a value for how many 1's are in a vector containing just 1's and zeros

>> greencars=[1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0] >> numer_of_ones = sum(greencars)

How do you get Matlab to return a value for how many 1's are in a vector containing just 1's and zeros

>> greencars=[1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0] >> numer_of_ones = sum(greencars)

9 years ago | 1

| accepted

Answered

Enlarge sample time in simulink

You can use, Simulink block named "Signal Generator" or "Repeating Sequence" or a "Pulse Generator" in the sources library of Si...

Enlarge sample time in simulink

You can use, Simulink block named "Signal Generator" or "Repeating Sequence" or a "Pulse Generator" in the sources library of Si...

9 years ago | 0

Answered

Creating a movie for n-body simulations

use "getframe" and "addframe" to "avifile" object. Look them up in help to learn how to make a movie. if you have the center o...

Creating a movie for n-body simulations

use "getframe" and "addframe" to "avifile" object. Look them up in help to learn how to make a movie. if you have the center o...

9 years ago | 0

Answered

How do I pass Simulink variables from the â€śConfiguration Parametersâ€ť to a GUI created using GUIDE?

Look up slConfigUIGetVal in MATLAB help.

How do I pass Simulink variables from the â€śConfiguration Parametersâ€ť to a GUI created using GUIDE?

Look up slConfigUIGetVal in MATLAB help.

9 years ago | 0

Answered

Calculating time for an external application executated from matlab

in MATLAB script tic % your calcs time = toc gives you the time in seconds.

Calculating time for an external application executated from matlab

in MATLAB script tic % your calcs time = toc gives you the time in seconds.

9 years ago | 0

Answered

Multiply matrices with complex values

The result is equivallent to A = [1+1i, 2+2i; 3+3i 4+4i]; B = [1+1i, 2+2i; 3+3i 4+4i]; C = abs(A)*abs(B) since ...

Multiply matrices with complex values

The result is equivallent to A = [1+1i, 2+2i; 3+3i 4+4i]; B = [1+1i, 2+2i; 3+3i 4+4i]; C = abs(A)*abs(B) since ...

9 years ago | 0

Answered

How do I access data from an array using for statements?

z = [ones(15,1),2*ones(15,1)] for j = 2:size(z,1) vel = z(j,1); % element of jth row and 1st column end

How do I access data from an array using for statements?

z = [ones(15,1),2*ones(15,1)] for j = 2:size(z,1) vel = z(j,1); % element of jth row and 1st column end

9 years ago | 0

Answered

Creating a vector field

I don't know why you put a zero at the end of VectorX and a zero at the beginning of VectorY which makes those lines incorrect. ...

Creating a vector field

I don't know why you put a zero at the end of VectorX and a zero at the beginning of VectorY which makes those lines incorrect. ...

9 years ago | 2

Answered

Blocks in Model seem to disappear when zooming in or out

I think you are panning and zooming. The blocks don't disappear. They are there but you need to scroll all the way up to see the...

Blocks in Model seem to disappear when zooming in or out

I think you are panning and zooming. The blocks don't disappear. They are there but you need to scroll all the way up to see the...

9 years ago | 0

Answered

Integrating multiple generators to a single system

In the configuration Parameters dialog box, check the sampling time for all the models. If the sampling time is on "Auto" then M...

Integrating multiple generators to a single system

In the configuration Parameters dialog box, check the sampling time for all the models. If the sampling time is on "Auto" then M...

9 years ago | 0

Answered

Terminating some Simulink samples

this is how I would do it: I would put a clock block (in Simulink sources library) and connect it to a "compare to constant" ...

Terminating some Simulink samples

this is how I would do it: I would put a clock block (in Simulink sources library) and connect it to a "compare to constant" ...

9 years ago | 0

| accepted

Answered

How to access Fundamental Sample Time value within a simulink model

In Simulink Library Browser, go to the Simulink, Signal Attributes, section. There is a block called Weighted Sample Time. Th...

How to access Fundamental Sample Time value within a simulink model

In Simulink Library Browser, go to the Simulink, Signal Attributes, section. There is a block called Weighted Sample Time. Th...

9 years ago | 0

Answered

Undefined Variables Error - Using GUIDE

Before that line, where gives you the error, line # 286, add this line: detector_type = handles.detector_type; Please not...

Undefined Variables Error - Using GUIDE

Before that line, where gives you the error, line # 286, add this line: detector_type = handles.detector_type; Please not...

9 years ago | 0

Answered

Solving non linear equations

YOu don't need to write your own nonlinear equation solver as MATLAB already has powerful built-in commands to do this, like fso...

Solving non linear equations

YOu don't need to write your own nonlinear equation solver as MATLAB already has powerful built-in commands to do this, like fso...

9 years ago | 1

Answered

How replace open by another function?

make sure, close(vidOut), the file is already closed and not corrupted. restart MATLAB then do it in command window to make sure...

How replace open by another function?

make sure, close(vidOut), the file is already closed and not corrupted. restart MATLAB then do it in command window to make sure...

9 years ago | 0

Answered

How do I improve loop performance when going through a large dataset? Or use another method?

My understanding of your question is that, you need to find specific data inside a huge structure. Your structure called invento...

How do I improve loop performance when going through a large dataset? Or use another method?

My understanding of your question is that, you need to find specific data inside a huge structure. Your structure called invento...

9 years ago | 0