已回答
Creating empty matrix with data in 1 cell
M = zeros(1,100); M(1,2:3) = 5% say 5 assign value of 5 to elements 2 and 3 in array

4 years 前 | 2

已回答
how do i plot the output vo against frequency ? i tried out however my graph seems weird thank you in advance
% Rf = 1.1; % Ri_minus = 0.2; % Vin = 10; syms Rf Ri_minus Vin Av=1+(Rf/Ri_minus); Vo= (1+(Rf/Ri_minus))*Vin; Vonew=subs(V...

4 years 前 | 0

已回答
How to run a while loop for each element in a row matrix?
inv_alpha = linspace (0, 0.3, 10) x = 0 y = zeros(size(inv_alpha)) for k = 1:length(inv_alpha) if y(k) < round (i...

4 years 前 | 1

| 已接受

已回答
How to compute the gradient at each point of an arbitrary symbolic curve defined by "n" points?
gradient(subs(unknown_points,x,value)); If x is the symbolic variables in array unknown_points then use _subs_ to repla...

4 years 前 | 0

| 已接受

已回答
For loop Index exceeds the number of array elements.
for k = 1:10 xx = x(k); funcx(k) = fun(xx); end T = table(x(:),funcx(:)); Once you assign x = x(k) then it becomes ...

4 years 前 | 1

| 已接受

已回答
I'm getting an error in my program for Adams predictor corrector method. It is relating to a sym being assigned to a double vector.
F=@(T,y) y-T^2+1;%creating the function from input, s [T,W]=newPC(F,0,2,10,0.5) function [T,W]=newPC(F,A,B,N,ALPHA) T = ze...

4 years 前 | 0

已回答
Cube Every Third Integer Using Nested Loop Structure
for i = [1:16] if (mod(i,3)==0) i^3 else i end end

4 years 前 | 1

已回答
Plotting residue vs iterations in matlab
A=[2 1 1 1 1; 1 3 1 2 1; 1 2 5 1 3; 2 3 1 4 1; 2 1 1 2 3]; %given matrix b=[5 1 17 0 10]'; r=[100 100 100 100 100]'; Em= 0.00...

4 years 前 | 1

| 已接受

已回答
Compute and plot Rayleigh Distribution probability density function
plot(x,v1,'--',x(1:300),v); axis([0 3 0 2]) Compare it with same vector lengths to view the Pdf

4 years 前 | 1

| 已接受

已回答
How to check if two equations are equal
clear syms t x1(t)=cos(t); y1(t)=1-2*x1(t-1); x2(t)=cos(t-3); y2(t)=1-2*x2(t-1); for t=-pi():.1:pi() Check_Y=vpa(y1...

4 years 前 | 1

| 已接受

已回答
I am trying plot a graph for the approximate integral against n, but nothing seems to be appearing on graph when i run this script.
f=@(x) x*sin(x); a=0; b=pi/2; n=3; h=(b-a)/n; s=0.5*(f(a)+f(b)); for i=0:n-1 s=s+f(a+i*h); i=h*s; plot(i,s,...

4 years 前 | 0

| 已接受

已回答
My code is running but very slow speed, I want make it fast so I want to create video of it
<https://in.mathworks.com/matlabcentral/answers/773008-i-m-trying-to-animate-both-the-plots-in-the-2-for-loops-simultaneously-bu...

4 years 前 | 1

| 已接受

已回答
how to create continues plot with respective time?
t=[0;0.0400801603206413;0.0801603206412826;0.120240480961924;0.160320641282565;0.200400801603206;0.240480961923848;0.280561122...

4 years 前 | 1

| 已接受

已回答
How do you properly type 1/e^x in matlab?
clc c=3*10^8; %speed of light (m/s) h=6.626*10^-23; %Planck constant (J-s) k=1.38*10^-23; %Boltzmann constant (...

4 years 前 | 0

| 已接受

已回答
I want to calculate dipol moment integral?
R = 4; e = 1.5; syms r fi_1 = (1/(2*pi)^(0.5))*exp((1i*r)./R); % wave function the fist state fi_3 = (1/(2*pi)^(0.5))*exp((1...

4 years 前 | 0

已回答
Having Issues Plotting a Yield Strength Line with 0.20% Offset
load = [0 1221 2479 3667 4903 6138 7356 8596 9783 11050 12247 13434 ... 14690 14744 15119 15710 16032 16295 16456 16585 166...

4 years 前 | 1

| 已接受

已回答
How to obtain a particular value from a matrix and reconstruct the matrix
A =[16 2 3 13; 5 11 10 8; 9 7 6 12; 4 14 15 1] [ii,jj]=find(A<9); A(A<9) = 0

4 years 前 | 0

| 已接受

已回答
Calculate the derivative of a segment function
a = 0.6; b = 0.1; x = linspace(0,3*a,181); Y = up(x,a,b); % plot(x,Y) % Here is my segment function % How can i calcula...

4 years 前 | 0

已回答
How to specify yticklabel at specific ticks?
A good example is available in the below link https://in.mathworks.com/matlabcentral/answers/233087-yticklabel-positioning-lab...

4 years 前 | 0

| 已接受

已回答
How to make my expression go to 0 after a certain value
RAz=20*10^3; MA=3*10^7; L=3000; E=210*10^3; I=7*10^6; syms x My_x= -RAz*x+MA phi_x=int(My_x/(E*I),x,[0 L/2])

4 years 前 | 0

已回答
Plotting a doppler frequency hyperbola
fd = linspace(400,5600,14); % Hz for i = 1:length(fd) h = @(x,y) sqrt((x.^2).*((6000/fd(i)).^2-1)-(y.^2)); subplot(...

4 years 前 | 0

| 已接受

已回答
Using a for loop to subplot graph parabolas?
figure x=-5:.1:5; a=[1.50000000000000,2,-2,2,0.500000000000000,-2,-1,1.50000000000000,2.50000000000000,2.50000000000000,-1.500...

4 years 前 | 0

| 已接受

已回答
How can I show a graph from the function?
G=[x(2);(-c*x(2)-k*x(1)+F0*cos(omega*t)/J]; % seems you have used // erroneously end it is a division operator unlike a c...

4 years 前 | 0

已回答
expected value of matrix
alpha = [0.0994 0.3661 -0.2125 0.2839] alpha.' E = alpha.*alpha.' Exp = mean(E) % expected value Use me...

4 years 前 | 0

| 已接受

已回答
Issue with Fourier Series Stair Step Function
n_count = 400; t_count = [0:1:24]; y_count = Fourier_Function(n_count, t_count); figure; plot(t_count, abs(y_count),'-.');...

4 years 前 | 0

| 已接受

已回答
How can I get values in table?
k=0.0001:1:10; U=1;a=1;Zeta=0.1; alpha1=real(sqrt(Zeta.^2./2+Zeta.*sqrt(Zeta.^2-4.*k.^2)./2)); alpha2=real(sqrt(Zeta.^2./2-Ze...

4 years 前 | 1

已回答
Coding in m-file, for a func defined in an interval [x0, xn] like Fi(x)(=(c1(i)+c2(i)*sin(w1*(x-x(i)))+c3(i)*cos(w2*(x-x(i)))+c4(i)*sin(w2*(x-x(i)))+c5(i)*cos(w1*(x-x(i))))?
% define c1, c2, c2, c4, c5 and W1, W2 etc c1 =1; c2 = 1.5; c3 = 4; c4 = 4.75; c5 =5; w1 = 2.3; w2 = 5; n = 100 ; x0 =...

4 years 前 | 0

| 已接受

已回答
How to plot a function dependent on no. of iterations, provided it plots till nth iteration where n is the number where the function is converged?
n= 10; e = 0; for m=1:n pu(m)=(-1)^m/((2*m)+1)*(exp(-((2*m)+1))) e = e+pu(m); if (abs(pu(m))/e)>(10^(-6)) %converg...

4 years 前 | 0

| 已接受

已回答
Code-m file for Sampling
clear all close all % Creating modulating signal fm=2; % message signal frequency (Hz) n=50; % factor of sampling frequenc...

4 years 前 | 0

| 已接受

加载更多