Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
Illegal use of 'end' in Simulink Coder when copying code from MATLAB to simulink function block
Remove the word _end_ from brackets

más de 4 años hace | 0

Respondida
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])

más de 4 años hace | 0

Respondida
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(...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

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

más de 4 años hace | 0

| aceptada

Respondida
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),'-.');...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 1

Respondida
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 =...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

| aceptada

Respondida
How do I obtain the amplitude of a PSD in dBm/kHz?
psdn = [-45.3953261464647;-46.3405836328469;-47.2863894168202;-48.2323917870060;-49.1782390282922;-50.1235796989143;-51.06806290...

más de 4 años hace | 1

| aceptada

Respondida
trying to use heun's method to solve an ode
a = 0; b = 10; n = 100; h = (b-a)/n; % T = a:h:b; F0 = 0; w = 0; m = 4; k = 10; c = 0.2; y0 = 4; h=(b-a)/n; ...

más de 4 años hace | 0

| aceptada

Respondida
Code not working?
clear; clc; % Given data E_f = 228000; % Elastic modulus of the fiber E_m = 1325; % Elastic modulus of the matrix G_f = 15...

más de 4 años hace | 1

Respondida
I have written the code for three differential equations for plotting the graph . I am not able to get the graph .
clc; clear all; close all; F = @(Z,X,Y) (1.07*Z*Z-Z*Z*Z-0.17*Z-(0.36*Z*X)-(0.0001*sqrt(Z*Y))/(1+0.2*sqrt(Z))) A = @(X,Y,Z)...

más de 4 años hace | 0

| aceptada

Respondida
Ode45 not working in matlab 2021b
zdot=inline('[z(2);-0.2*z(2)-sin(z(1))]','t','z') Check your zdot function. There is no variable with _t_ defined in it...

más de 4 años hace | 0

Respondida
How can I remove some specific lines from this contour plot
Easy way is that you can select "Edit" option from the figure window after plotting and click on figure properties. Then click o...

más de 4 años hace | 2

| aceptada

Respondida
TASK 5 PROBLEM SIMULINK ONRAMP
Set the initial condition source to external and try

más de 4 años hace | 0

Respondida
How Do I Properly Format my Bar Graph?
x = [379.5 , 1138.3 , 1897.2 , 2656]; % your values y = rand(size(x)); bar(x, y) xlabel('Number in the Thousands (ie 4,000)'...

más de 4 años hace | 1

Respondida
why do I keep getting this error message
t = 0:1/320:0.5; x = @(t) 6*cos(4*pi*t)+2*sin(16*pi*t) -4*sin(32*pi*t);% define anonymous function x(t) plot(x(t))

más de 4 años hace | 0

Respondida
Hi COMM, How can I hold only one plot while updating the rest in a figure ? E.g. I want to keep (x,f) plot fixed , while keeping the current value for the animated plot
for k=1:length(x) plot(x(1:k),f(1:k),'or') axis([SSmin SSmax 0 30]) pause(2) end Check with this

más de 4 años hace | 0

Respondida
How ro divide a scalar by a excel data and plot the result?
X= 51./data(:,4); Use the element wise division operator

más de 4 años hace | 0

| aceptada

Respondida
How can ı solve invalid indexing or function
clc; clear all; syms nw W x Q(x) Y Qo ode1=diff(Q,x)== -nw*W*Y; cond1 = Q(0)== 0; cozum1(x)=dsolve(ode1,cond1); cozum1=s...

más de 4 años hace | 0

Respondida
Need a help to design a block.
If there is no standard block for flow rate in (Smmulink or Simscape)library, then you can define 2 variables as signals. One fo...

más de 4 años hace | 0

| aceptada

Respondida
Matlab code - can anyone guide me how to sort this kind of error, I am new to MATLAB and trying to create an interface for a audio listening experiment
function varargout = TEST(varargin) % TEST MATLAB code for TEST.fig % TEST, by itself, creates a new TEST or raises the e...

más de 4 años hace | 0

| aceptada

Respondida
How to plot subset of X-axis names on bar plot?
plotNamesD = plotNames(1:kId);% use the for loop index plotDataD = plotData(1:kId); bar(plotNamesD,plotDataD); hold ...

más de 4 años hace | 0

| aceptada

Respondida
reading and interpreting statistical chart
<https://in.mathworks.com/help/matlab/ref/pie.html> Check this link

más de 4 años hace | 0

| aceptada

Respondida
Plotting a Piecewise Function
syms x z(x) y=piecewise(x<0,0, x>0,1); z(x)=(1+(x-1).*exp(-x)).*y; fplot(z,[-3 3]) Best wishes

más de 4 años hace | 0

| aceptada

Cargar más