Answered

Not enough input argument in ode45

[t,x] = ode45(@mastersystem,[0 10],[0 0 0 0 0 0]); % use a function handle to pass function as argument plot(t,x) function d...

Not enough input argument in ode45

[t,x] = ode45(@mastersystem,[0 10],[0 0 0 0 0 0]); % use a function handle to pass function as argument plot(t,x) function d...

3 meses ago | 0

Answered

What's wrong with my distribution function?

X = -100 : 1 : 100; Y = -100 : 1 : 100; k = 4; G = gamma(k/2) [ XX, YY ] = meshgrid( X, Y ); A = ( XX ).^2 + ( YY ).^2; A ...

What's wrong with my distribution function?

X = -100 : 1 : 100; Y = -100 : 1 : 100; k = 4; G = gamma(k/2) [ XX, YY ] = meshgrid( X, Y ); A = ( XX ).^2 + ( YY ).^2; A ...

3 meses ago | 1

Answered

Plot measured Filter data

T = readtable('Plot.xls') frequency = T{(22:109),1}; % change this to ffequency gain = T{(22:109),2}; phase = T{(22:109),...

Plot measured Filter data

T = readtable('Plot.xls') frequency = T{(22:109),1}; % change this to ffequency gain = T{(22:109),2}; phase = T{(22:109),...

3 meses ago | 0

| accepted

Answered

matlab indexing issue with range -pi:pi

amin=0.2; theta = -pi:pi/2:pi; gamma=0:0.5:3; for T=1:length(theta) for G = 1:length(gamma) phi=amin-(-pi/2); ...

matlab indexing issue with range -pi:pi

amin=0.2; theta = -pi:pi/2:pi; gamma=0:0.5:3; for T=1:length(theta) for G = 1:length(gamma) phi=amin-(-pi/2); ...

3 meses ago | 0

| accepted

Answered

phase shift using xcorr

t = 1 :0.1: 20; phaseshift= pi/2; s1 = sin(2*t); s2 = sin(2*t+ phaseshift); figure(1); clf; plot (t...

phase shift using xcorr

t = 1 :0.1: 20; phaseshift= pi/2; s1 = sin(2*t); s2 = sin(2*t+ phaseshift); figure(1); clf; plot (t...

3 meses ago | 0

Answered

I am trying to find the integral gain (ki) of the following transfer function.

syms ki ki = 10 % e.g numeric values , not symbolic sys = tf([30.672 175.694*ki],[1 38.672 175.694*ki]); S = stepinfo(sys); ...

I am trying to find the integral gain (ki) of the following transfer function.

syms ki ki = 10 % e.g numeric values , not symbolic sys = tf([30.672 175.694*ki],[1 38.672 175.694*ki]); S = stepinfo(sys); ...

3 meses ago | 0

Answered

Hold on with subplot in a loop

A={[40;50;60] [70;80;90] [20;30;50]}; B={[45;55;65] [75;85;95] [25;35;55]}; T=[1;2;3]; figure(1) % use this outside of l...

Hold on with subplot in a loop

A={[40;50;60] [70;80;90] [20;30;50]}; B={[45;55;65] [75;85;95] [25;35;55]}; T=[1;2;3]; figure(1) % use this outside of l...

3 meses ago | 0

Answered

Question about the inability to display 16k octave bands(1/3 oct band)？

if fs==22050 fc=1000*2.^((-6:1:2)); fctxt={'16','32','63','125','250','500','1k','2k','4k'}; else fc=1000*...

Question about the inability to display 16k octave bands(1/3 oct band)？

if fs==22050 fc=1000*2.^((-6:1:2)); fctxt={'16','32','63','125','250','500','1k','2k','4k'}; else fc=1000*...

3 meses ago | 1

| accepted

Answered

Error using FDE12

s = 1:4; % define s vector passed as argument to function line below e.g. values sdot = @(t,s)[A-(e*s(1)*s(2))-(a*s(1)*s(3))+...

Error using FDE12

s = 1:4; % define s vector passed as argument to function line below e.g. values sdot = @(t,s)[A-(e*s(1)*s(2))-(a*s(1)*s(3))+...

3 meses ago | 0

Answered

An error in my code

clear syms x % syms F= atan(x); t5= taylor(F,x,'order',5); t7= taylor(F,x,'order',7); fplot(x^3/3+x,[-pi pi],'b') hold o...

An error in my code

clear syms x % syms F= atan(x); t5= taylor(F,x,'order',5); t7= taylor(F,x,'order',7); fplot(x^3/3+x,[-pi pi],'b') hold o...

3 meses ago | 2

Answered

I do some revisions to my equation but I still got no answer. It says that there is no enough input argument. Can someone please help me?

x0=[150;150;150;150;150;150;150]; % x = 1:7; % give input vector to fucntion sol=fsolve(@rle,x0) % call the function using fu...

I do some revisions to my equation but I still got no answer. It says that there is no enough input argument. Can someone please help me?

x0=[150;150;150;150;150;150;150]; % x = 1:7; % give input vector to fucntion sol=fsolve(@rle,x0) % call the function using fu...

3 meses ago | 0

| accepted

Answered

Pcolor Plot returning error Color data input must be a matrix.

h = pcolor(X1, Y1, z); % use X1, Y1 instead of x1 , y1, z must be 21x26 matrix

Pcolor Plot returning error Color data input must be a matrix.

h = pcolor(X1, Y1, z); % use X1, Y1 instead of x1 , y1, z must be 21x26 matrix

3 meses ago | 0

Answered

how to plot solution of ODE eqution with out using fplot ?

% this code is used to show how to use ode in matlab, via a simple problem % for serios RC circuit with DC supply clc;clear a...

how to plot solution of ODE eqution with out using fplot ?

% this code is used to show how to use ode in matlab, via a simple problem % for serios RC circuit with DC supply clc;clear a...

3 meses ago | 1

| accepted

Answered

How can I store the whole diagonal and not only the first element (For loop)

% Part 3.1: Diagonal %A rng('default') r2 = randi(100,3,3); % Creating a 3x3 matrix, with random values from 1 to 100 %B ...

How can I store the whole diagonal and not only the first element (For loop)

% Part 3.1: Diagonal %A rng('default') r2 = randi(100,3,3); % Creating a 3x3 matrix, with random values from 1 to 100 %B ...

3 meses ago | 0

| accepted

Answered

Why is ySol(t) = Dsolve(ode,cond) wrong? What should it be instead?

y=eval(ySol(t))% Use ySol(t) to evaluate

Why is ySol(t) = Dsolve(ode,cond) wrong? What should it be instead?

y=eval(ySol(t))% Use ySol(t) to evaluate

3 meses ago | 0

Answered

Having trouble writing a multiple gravitational physics simulation code, as every planet effects one another.

a(q,:)=(sum(F(q:(q+o-1),:)))./mass(q); %Calculate acceleration of each planet v(q,:)=v(q,:)+a(q,:)*ts; %calula...

Having trouble writing a multiple gravitational physics simulation code, as every planet effects one another.

a(q,:)=(sum(F(q:(q+o-1),:)))./mass(q); %Calculate acceleration of each planet v(q,:)=v(q,:)+a(q,:)*ts; %calula...

3 meses ago | 0

Answered

Trouble graphing this non-linear function

x = 1:100; y = ((factorial(x)).^(1./x))./x; % use element wise division fplot(y,[0 100]) % no space between function and par...

Trouble graphing this non-linear function

x = 1:100; y = ((factorial(x)).^(1./x))./x; % use element wise division fplot(y,[0 100]) % no space between function and par...

3 meses ago | 0

Answered

I am trying to a series generated from complex function but it gives to me an error.

clear; clc; syms k Delta=0; chi=0; theta=0; alpha=5; phi=0; bn=exp(-0.5*alpha^2)*(alpha^k)/sqrt(gamma(k+1)); bn1=exp(-0...

I am trying to a series generated from complex function but it gives to me an error.

clear; clc; syms k Delta=0; chi=0; theta=0; alpha=5; phi=0; bn=exp(-0.5*alpha^2)*(alpha^k)/sqrt(gamma(k+1)); bn1=exp(-0...

3 meses ago | 0

Answered

using for loops to calculate compound interest with yearly contributions

N=17804; P=1000; C=1000; r=(10/100); I = 1; while P<=N y(I)=(P*(1+r)); % use an index for desired amount, P=y(I)...

using for loops to calculate compound interest with yearly contributions

N=17804; P=1000; C=1000; r=(10/100); I = 1; while P<=N y(I)=(P*(1+r)); % use an index for desired amount, P=y(I)...

3 meses ago | 0

Answered

Semilogx function giving a linear scale

S = [1e-2 1e-1 1 10 100 1000 1e4]; % Remdesivir concentration, in uM Km = 0.5; % Equilibrium constant, in uM Vmax = 0.82; % ma...

Semilogx function giving a linear scale

S = [1e-2 1e-1 1 10 100 1000 1e4]; % Remdesivir concentration, in uM Km = 0.5; % Equilibrium constant, in uM Vmax = 0.82; % ma...

3 meses ago | 0

| accepted

Answered

Need help with syntax and how to use sigma in matlab

clear close all Z1=500 Z2=50 Z3=500 u=1 tau1=(2*Z2)/(Z1+Z2) tau2=(2*Z1)/(Z1+Z2) tau3=(2*Z3)/(Z3+Z2) p1=(Z2-Z1)/(Z2+Z1...

Need help with syntax and how to use sigma in matlab

clear close all Z1=500 Z2=50 Z3=500 u=1 tau1=(2*Z2)/(Z1+Z2) tau2=(2*Z1)/(Z1+Z2) tau3=(2*Z3)/(Z3+Z2) p1=(Z2-Z1)/(Z2+Z1...

3 meses ago | 1

| accepted

Answered

Unable to perform assignment because the size of the left side is 1-by-2 and the size of the right side is 2-by-2. (Line 32)

pp=@(t,x)[.23*x(1)-.0133*x(1)*x(2); -.4*x(2)+.0004*x(1)*x(2)] [t,y]=rk4sys(pp,[0,65],[550,20],0.3) figure(1) plot(t,y(:,1),...

Unable to perform assignment because the size of the left side is 1-by-2 and the size of the right side is 2-by-2. (Line 32)

pp=@(t,x)[.23*x(1)-.0133*x(1)*x(2); -.4*x(2)+.0004*x(1)*x(2)] [t,y]=rk4sys(pp,[0,65],[550,20],0.3) figure(1) plot(t,y(:,1),...

3 meses ago | 1

Answered

How to skip a data set in the legend of a plot?

clear; clc; clf; close all; x1 = [0.015 0.020 0.050 0.100 0.200 0.300 0.400 0.500]; y1 = [5.518E-11 7.215E-11 1.832E-10 ...

How to skip a data set in the legend of a plot?

clear; clc; clf; close all; x1 = [0.015 0.020 0.050 0.100 0.200 0.300 0.400 0.500]; y1 = [5.518E-11 7.215E-11 1.832E-10 ...

3 meses ago | 1

| accepted

Answered

how to put for loop value into a vector

k = 0.168:0.168:1.68 ; for x=1:length(k) if k(x)>=0.03 && k(x)<=0.06 h(x)=1.437*k(x)^(-0.279); elseif k(x)>=0.07 && k(x)<...

how to put for loop value into a vector

k = 0.168:0.168:1.68 ; for x=1:length(k) if k(x)>=0.03 && k(x)<=0.06 h(x)=1.437*k(x)^(-0.279); elseif k(x)>=0.07 && k(x)<...

4 meses ago | 0

Answered

fplot invalid parameter error

m=100; k1=1500; k2=2500; k3=700; wb=4.4; Y=0.05; w1=sqrt(k1/m); w2=sqrt(k2/m); w3=sqrt(k3/m); r1=wb/w1; r2=wb/w2; r...

fplot invalid parameter error

m=100; k1=1500; k2=2500; k3=700; wb=4.4; Y=0.05; w1=sqrt(k1/m); w2=sqrt(k2/m); w3=sqrt(k3/m); r1=wb/w1; r2=wb/w2; r...

4 meses ago | 1

Answered

Error with the command Geoplot

lat=cell2mat(A.Latitud);% if Latitud is the header name of column. Please check this. There Was extra parenthesis in my pr...

Error with the command Geoplot

lat=cell2mat(A.Latitud);% if Latitud is the header name of column. Please check this. There Was extra parenthesis in my pr...

4 meses ago | 0

Answered

Multiplying f(x) with f(-x)

cof = [1 15 7 2] syms x F(x) F = (cof(1)*x.^3+cof(2)*x.^2+cof(3)*x+cof(4)) FF = subs(F,x,-x) Fx = F.*FF % resulting produc...

Multiplying f(x) with f(-x)

cof = [1 15 7 2] syms x F(x) F = (cof(1)*x.^3+cof(2)*x.^2+cof(3)*x+cof(4)) FF = subs(F,x,-x) Fx = F.*FF % resulting produc...

4 meses ago | 0

| accepted

Answered

Discontinuous display in Simulink Scope

Select the plot type as Auto in scope block. This plots the graph as continuous signals instead of discrete ones which you have...

Discontinuous display in Simulink Scope

Select the plot type as Auto in scope block. This plots the graph as continuous signals instead of discrete ones which you have...

4 meses ago | 0

Answered

Why is my if counter not working

s= 0 x = linspace(-1,1, 50) n = linspace(1,10,50) L = 2 total = 0 s= zeros(size(n)) for i = 1:length(n) s(i) = (8/(p...

Why is my if counter not working

s= 0 x = linspace(-1,1, 50) n = linspace(1,10,50) L = 2 total = 0 s= zeros(size(n)) for i = 1:length(n) s(i) = (8/(p...

4 meses ago | 0

Answered

I need to plot a graph of P, Rdia and Vo, please help me how to get graph. (for every 10 increment of pressure, there is 1 ohm increment of Rdia , and display the output vo)

Rdia = 3673; % dia resistance value in ohm ; Rtemp = 3618; % Temperature resistance value in ohm; R1 = 3600; % fixed resistanc...

I need to plot a graph of P, Rdia and Vo, please help me how to get graph. (for every 10 increment of pressure, there is 1 ohm increment of Rdia , and display the output vo)

Rdia = 3673; % dia resistance value in ohm ; Rtemp = 3618; % Temperature resistance value in ohm; R1 = 3600; % fixed resistanc...

4 meses ago | 1

| accepted