How to give a piecewise function as input
clear all clc syms t s y(t) Y dy(t)=diff(y(t)); d2y(t)=diff(y(t),2); F = [-1 1 16]; %input('Input the coefficients [a,b,c]:...

2 months ago | 0

my plot for current vs speed of an energy efficient vs standard efficiency induction machine is not showing any values
clear s=0.0005:0.0005:1; %Slip [pu] f = 50; p = 4; ns=120*f/p; n=(1-s)*ns; R1=1.1; X1 = 0.2; Xm = 1e-3; R2 = 3.4; X2...

2 months ago | 0

Peltier Device not cooling
T_A = a1+b1*dt; % a1, a2 b1 b2 are some coefficients in your model. T_B = a2 +b2*dt; dt = 0:0.1:100; % time vector for k = ...

2 months ago | 0

My Fourier Series plotter isn't outputting correct y-values
plot(yfit(1:Ts:end)) % plot your fourierseries It seems you have already computed the fourier series, To visualize the smooth...

2 months ago | 0

User input changes circle radius and velocity
v=10;%input('Please provide a particle velocity: \n'); r=5; %input('Please provide a radius: \n'); e.g. radius here x0 = -...

2 months ago | 0

Not enough input arguments.
clear all; close all; clc; % phi=0.9*pi; phi0=pi/3; phi=0:0.1:2*pi; %%PRC Type-1: z=(1-cos(phi)).*exp(3*(cos...

2 months ago | 0

| accepted

If loop to use different formulae under different conditions
P_load=832.40; P_unload=901.35; rho=1.2; R= 0.287; T_std=293; T_stdf=((T_std-273)*(9/5))+32; T_atm=304; T_atmf=...

2 months ago | 0

How to plot constant vector field: f(x,y)=2 ax + ay
x=-3:3; y=-5:5; [x,y]=meshgrid(x,y); u=repmat(2,length(x),7); v=repmat(1,length(x),7); quiver(x,y,u,v)

2 months ago | 0

| accepted

Radar scattering coefficient plot
clc clear all close all theta=0:0.1:90; K=linspace(0,50,length(theta)); sc=K.*exp(-theta./30); polarplot(theta*pi/180,sc...

2 months ago | 0

| accepted

Plot Straight Line Segments
yline(200); xlim([0 20]);

2 months ago | 0

How to use writetable in a for loop
T{k} = regionPropertiesTable(31,4) Use a cell array for all participants. Later use writetable(T) Outside of loop

2 months ago | 1

| accepted

Question on summing function handles
for j = 1:length(N1) % remaining code here S1 = @(t,x) ((-56.*(1-sqrt((x-xj).^2+(t-tj).^2)).^6.*(35*sqrt((x-xj).^2+(t-...

2 months ago | 0

| accepted

How to plot multiple graphs using different values for one of the variables?
for sigmaR=[20,60,8,450,35,5] % put this in [ ] plot(f,alphat) hold on end Put the loop vector in [ ] and use ho...

2 months ago | 0

| accepted

Solving differential equation with Runge Kutta 4th order
a=0; b=1; %Stepsize h=0.05; %time interval and initial value t=(a:h:b)'; x(1)=0.032; parameter=0.15; t1=zeros(siz...

2 months ago | 1

| accepted

fix the indices of the matrix
close all;clear;clc; load('ecg_sbj1.mat') sig=ecg N=length(sig); fs=200; t=[0:N-1]/fs b=1/32*[1 0 0 0 0 0 -2 0 0 0 0 0 1];...

2 months ago | 0

solving diffrential equation systems
v1=1000; v2=1500; v3=100; k1=.1; k2=.2; k3=.4; syms f(t) g(t) y(t) eq1 = diff(f)==((1/v1)*(1000+100*g-1100*f-k1*v1*f)) ...

2 months ago | 0

Frequency plot not working properly when using IFFT
time_step=(Time(2)-Time(1)); Check with timestep. It may not be constant difference between first two values in _Time_ vect...

2 months ago | 0

| accepted

Plot X, Y, Z axes with respect to time
x_back_accel = cell2mat(backside_accel(:,1)); y_back_accel = cell2mat(backside_accel(:,2)); z_back_accel = cell2mat(backside...

2 months ago | 0

Unable to solve this coupled boundary value differential Equation
if iterator1==1 ic = [p21 1 0 0 p11]; [T,Y] = ode45(@(T,Y) ftotal(Pr,T,Y), etaspan, ic); m21=Y(end,1...

2 months ago | 0

File: bvpfcn.m Line: 1 Column: 23 Invalid use of operator.
guess = [2;1]; xmesh = linspace(0,1,5); solinit = bvpinit(xmesh,guess); sol = bvp4c(@ode,@bc,solinit) % equation to solve pl...

2 months ago | 0

How can I assign multiple inputs into variables
%% Calculation %Station 1 R = 287; %Gas constant T01= 339; %Stagnation Temperature or total inlet temperature Patm = 10132...

2 months ago | 0

How to Combine ODE Plots with Different Initial Concentration
Rentang = linspace(0, 48, 50); C0 = [0.2781456954 5.197889182 52.77015848]; %biomass, substrate, product initial concentration ...

2 months ago | 0

| accepted

Table shows 1x1 sym
function s = angle(r2,a2) Change the return value in function to s

2 months ago | 0

Generation of error matrix from AR(1) model, issue
t=5; n=10; u_t = randn(1,n) %innovation term epsilon = zeros(t,n); %preallocation rho=0.5; %parameter ρ for the AR(1) model ...

2 months ago | 0

| accepted

I am facing problem with the code which i giving below.
% Solving ODE for Pendulum clear all close all clc t = [0 30]; theta0 = [30 0 0]; L = 5; m = 2; g = 9.8;...

2 months ago | 0

HOW TO PLOT SINGLE GRAPH OF TWO EQUATION WHICH IS CONDITIONALLY SATISFIED
clear all; Vds=0:0.01:.3; Vt=0.4; Vgs=0.6; Mn=398*10^-4; Cox=9.99*10^-10; p=2; k=Mn*Cox*p; for kk = 1:length(Vds) if Vds(k...

2 months ago | 0

Plotting a high order function
plot(x,f2(x),'.k') give the necessary input values to functions created.

2 months ago | 0

| accepted

Saving values of a variable in while loop
errorVal(n,:)=sum(error(:));

2 months ago | 0