Answered

Transfer Function in Simulink

Use those variables (a and b) in the simulation, define them in the workspace with default values before the simulation starts ...

Transfer Function in Simulink

Use those variables (a and b) in the simulation, define them in the workspace with default values before the simulation starts ...

13 years ago | 0

| accepted

Answered

multiple bode plots on same graph

Maybe something with *hold on*?! g = tf([1 0.1 7.5],[1 0.12 9 0 0]); bode(g) hold on g = tf([1],[1 0.12 9 0 0]); ...

multiple bode plots on same graph

Maybe something with *hold on*?! g = tf([1 0.1 7.5],[1 0.12 9 0 0]); bode(g) hold on g = tf([1],[1 0.12 9 0 0]); ...

13 years ago | 1

Answered

vectors from array

a=randi(5,3,5) %sample array %put all columns of the array in diferent cells b=arrayfun(@(x)a(:,x),1:size(a,2),'un...

vectors from array

a=randi(5,3,5) %sample array %put all columns of the array in diferent cells b=arrayfun(@(x)a(:,x),1:size(a,2),'un...

13 years ago | 0

Answered

Reset button

set(findobj(0,'style','edit'),'string','') %put this in the button callback %that should clear all edit uicontrols or s...

Reset button

set(findobj(0,'style','edit'),'string','') %put this in the button callback %that should clear all edit uicontrols or s...

13 years ago | 2

Answered

Repetition of rows of a matrix maintaining the number of columns

A=[ 1 2 3 4 5 6] N=1; %number of repeats kron(A,ones(N+1,1))

Repetition of rows of a matrix maintaining the number of columns

A=[ 1 2 3 4 5 6] N=1; %number of repeats kron(A,ones(N+1,1))

13 years ago | 1

Answered

Frequence of the signal

From the MATLAB documentation of the fft function: Fs = 1000; % Sampling frequency T = 1/Fs; ...

Frequence of the signal

From the MATLAB documentation of the fft function: Fs = 1000; % Sampling frequency T = 1/Fs; ...

13 years ago | 0

Answered

compute number of pulses for ECG signal

Find the number of peaks with the Signal Processing Toolbox™ *findpeaks* function or one similar function from the <http://www.m...

compute number of pulses for ECG signal

Find the number of peaks with the Signal Processing Toolbox™ *findpeaks* function or one similar function from the <http://www.m...

13 years ago | 0

Answered

MATLAB - Stop execution of .m file while Simulink is running

Use the Simulink *sim* function instead to start the simulation, that way after the simulation is over the code continues execut...

MATLAB - Stop execution of .m file while Simulink is running

Use the Simulink *sim* function instead to start the simulation, that way after the simulation is over the code continues execut...

13 years ago | 1

Answered

How to divide and times in matlab

1/sqrt(R^2+(w*L-1/(w*C))^2) if perhaps you are working with arrays or vectors and you want the operations to be performed ele...

How to divide and times in matlab

1/sqrt(R^2+(w*L-1/(w*C))^2) if perhaps you are working with arrays or vectors and you want the operations to be performed ele...

13 years ago | 1

Answered

Are you convert matlab code to visual basic code form for me, please?

clc,clear all x = 0:0.2:1; % get a dimensional array of real number type fid = fopen('dene3.txt','w';); ...

Are you convert matlab code to visual basic code form for me, please?

clc,clear all x = 0:0.2:1; % get a dimensional array of real number type fid = fopen('dene3.txt','w';); ...

13 years ago | 0

Answered

finding a mathematical function that passes from specified points

x=[10 30 50 100 125 250 350 500 550 750 1000]; y=[91 92 93.2 93.5 94 95.2 95.4 95.1 95 94.5 93.8]; plot(x,y,'o') n=8;...

finding a mathematical function that passes from specified points

x=[10 30 50 100 125 250 350 500 550 750 1000]; y=[91 92 93.2 93.5 94 95.2 95.4 95.1 95 94.5 93.8]; plot(x,y,'o') n=8;...

13 years ago | 1

| accepted

Answered

Comparing two matrices, and acting upon the result element by element.

A=randi(5,3,3) B=10*randi(5,3,3)+5 v=2 %your specific value A(A==v)=B(A==v) %replace elements of A equal t...

Comparing two matrices, and acting upon the result element by element.

A=randi(5,3,3) B=10*randi(5,3,3)+5 v=2 %your specific value A(A==v)=B(A==v) %replace elements of A equal t...

13 years ago | 0

| accepted

Answered

Using Figure

doc subplot example t=0.01:0.01:1; x=rand(100,2); subplot(211) plot(t,x(:,1),'red','linewidth',2 ) xlabel('Time (s...

Using Figure

doc subplot example t=0.01:0.01:1; x=rand(100,2); subplot(211) plot(t,x(:,1),'red','linewidth',2 ) xlabel('Time (s...

13 years ago | 1

Answered

how do I reshape an array into a matrix that has dimensions of (user indicated number) by 4?

parameter =[1 2 3 4 1 2 3 4 1 2 3 4] reshape(parameter,4,3)

how do I reshape an array into a matrix that has dimensions of (user indicated number) by 4?

parameter =[1 2 3 4 1 2 3 4 1 2 3 4] reshape(parameter,4,3)

13 years ago | 0

Answered

Creating a distance matrix in Matlab?

On the Neural Network Toolbox™ you have the mandist function that seems to do what you need, if you don't have that toolbox try ...

Creating a distance matrix in Matlab?

On the Neural Network Toolbox™ you have the mandist function that seems to do what you need, if you don't have that toolbox try ...

13 years ago | 0

Answered

Matrix - empty selected cells

You might encounter problems when removing values from array because the dimensions must be consistent M = [ 1.23 1.34-4i 275...

Matrix - empty selected cells

You might encounter problems when removing values from array because the dimensions must be consistent M = [ 1.23 1.34-4i 275...

13 years ago | 0

Answered

Create Labview/Simulink like environment with GUIDE?

I'm not familiar with Labview but I made several GUI's that control Simulink simulations, you can have something like this <http...

Create Labview/Simulink like environment with GUIDE?

I'm not familiar with Labview but I made several GUI's that control Simulink simulations, you can have something like this <http...

13 years ago | 0

Answered

Help needed displaying multiple plots (and maybe preassigning too)

doc hold %allows you to have more than one plot on a axes doc subplot %if you want more than one axes on a figure <ht...

Help needed displaying multiple plots (and maybe preassigning too)

doc hold %allows you to have more than one plot on a axes doc subplot %if you want more than one axes on a figure <ht...

13 years ago | 0

Answered

Detect P-code

Maybe this: a=dbstack('-completenames'); if (isempty(strfind(a.file,'.m'))) disp('pcode') else disp('mfile') ...

Detect P-code

Maybe this: a=dbstack('-completenames'); if (isempty(strfind(a.file,'.m'))) disp('pcode') else disp('mfile') ...

13 years ago | 0

| accepted

Answered

In an assignment A(I) = B, the number of elements in B and I must be the same.

syms t x=-3:.1:3; for i=1:length(x); Pin=3*exp(-t^2); z=x(i); Eo(i)=int(Pin,t,-inf,z); ...

In an assignment A(I) = B, the number of elements in B and I must be the same.

syms t x=-3:.1:3; for i=1:length(x); Pin=3*exp(-t^2); z=x(i); Eo(i)=int(Pin,t,-inf,z); ...

13 years ago | 0

Answered

Expression (equation)

Simplest version I can think of t=0:0.1:100; % Time vector A=0.1; % Value of A that you can c...

Expression (equation)

Simplest version I can think of t=0:0.1:100; % Time vector A=0.1; % Value of A that you can c...

13 years ago | 0

| accepted

Answered

problem in using symbols

doc vpa %just a wild guess of something that might be useful to you

problem in using symbols

doc vpa %just a wild guess of something that might be useful to you

13 years ago | 0

Answered

GUI Matlab

I don't think that Mathworks implemented the feature yet, take a look at how the users are making GUIs with tabs, for example <h...

GUI Matlab

I don't think that Mathworks implemented the feature yet, take a look at how the users are making GUIs with tabs, for example <h...

13 years ago | 0

Answered

print in a loop

fprintf('\n') for i=1:3 fprintf('p[%d] ',i) end fprintf('\n') or a fancy version with comma fprintf('\n') fo...

print in a loop

fprintf('\n') for i=1:3 fprintf('p[%d] ',i) end fprintf('\n') or a fancy version with comma fprintf('\n') fo...

13 years ago | 0

Answered

tf object manipulation

Small example syms s Numerator=[1]; Denominator=[1 0 1]; sys=tf(Numerator,Denominator) ex=evalc('sys') ...

tf object manipulation

Small example syms s Numerator=[1]; Denominator=[1 0 1]; sys=tf(Numerator,Denominator) ex=evalc('sys') ...

13 years ago | 0

| accepted

Answered

user interface

By MATLAB window you mean Figure don't you? What you want to do is a GUI, that can be done using GUIDE or by doing all the co...

user interface

By MATLAB window you mean Figure don't you? What you want to do is a GUI, that can be done using GUIDE or by doing all the co...

13 years ago | 0

| accepted

Answered

Quickie, global variables and sub functions.

The variables should be passed to the functions as arguments, using global variables always introduce problems that are hard to ...

Quickie, global variables and sub functions.

The variables should be passed to the functions as arguments, using global variables always introduce problems that are hard to ...

13 years ago | 4

| accepted

Answered

exponential curve

From the User-Defined Functions use the MATLAB Fcn, the code you should put in that block is exp(u(1)) Now for input try the...

exponential curve

From the User-Defined Functions use the MATLAB Fcn, the code you should put in that block is exp(u(1)) Now for input try the...

13 years ago | 0

| accepted