Answered
Change plot scale y axis
u21=[224 224 224 223 218 218 217]; beta1=[0 0.19 0.26 0.38 0.76 0.83 0.9]; plot(beta1,u21,'-*'); xlabel('beta') ylabel('U[V]...

9 dagar ago | 1

Answered
Bar graphs don't group bars if there is only one group in the data
% Artificial data: Two vertical vectors of height 3 x=reshape(randperm(6),3,2) % Correct grouping into pairs subplot(1,2,1)...

9 dagar ago | 0

Answered
Taking derivative and putting it equal to 0 to find theta.
syms x s h S = (6*s*h) - ((3*s*s*cot(x))/2) + ((3*s*s*sqrt(3)*csc(x))/2) Y = diff(S,x) == 0 % take derivative of equation w....

9 dagar ago | 0

Answered
I want help solving differential equations
syms x y(x) eqn = diff(y(x),x)+sqrt((1-y^2)/(1-x^2))==0 cond = [y(0) == 1;y(1) == 0] % check with some other initial conditio...

9 dagar ago | 0

| accepted

Answered
how to replace/import .mat file with parameter values?
A = load(websave('X','https://in.mathworks.com/matlabcentral/answers/uploaded_files/1213353/torque_for_Sid.mat')) speed = 1000/...

10 dagar ago | 0

Answered
fprintf results into 2 columns
clc; clear; close all; principal = 1000;%input('Enter Principal in Dollars: '); years = 5;%input('Enter Number of years: '); ...

10 dagar ago | 2

| accepted

Answered
copy corresponding values of 2nd metrics depend on 1st metrics values
Z=[]; ii=0 Z2=[]; iii=0; Z3=[]; iiii=0; X = rand(10) Y = rand(10) [RawX, ColX]= size(X) for j=1:RawX; for n=1:ColX...

10 dagar ago | 0

Answered
Create an alternating matrix
maxV = 20; stepS = 5; I = zeros(1,2*(maxV/stepS)+1); I1 = 0:stepS:maxV; I2 = -I1(2:end); I(1:2:end) = I1; I(2:2:end) = I2;...

10 dagar ago | 0

Answered
I am getting error while trying to generate data for qtot_eV through variation of "d".
As the error states, you need to provide scalar values for integral limits betaevanmax=10./max(d); % use a scalar value for up...

10 dagar ago | 0

| accepted

Answered
my code output is right but my graph gives me nothing it's blank and I don't know why it wont work there are no error just gives a graph with nothing on it
Use loop index if Price(i) < buy stock(i) = stock(i)+25; % use loop index ... elseif sell < Price(i) stock(i) = stock(i...

10 dagar ago | 1

| accepted

Answered
Plotting a line using one point and a slope in the loglog scale
x = (25081:1000:10000000); m = -3.62; x1 = 25081; % use coordninate y1 = 3.046e-16; y = m*(x-x1)+ y1 loglog(x, abs(y)) % ...

11 dagar ago | 0

Answered
Run a function inside a for loop 10,000 times and record the 3 separate outputs for each trial
Sl(trials) = S; Ml(trials) = M; Ll(trials) = L;

11 dagar ago | 0

Answered
Creating a specific time subplot
%hold on. Comment this line subplot(2,1,2) Comment the line above

11 dagar ago | 0

| accepted

Answered
Error in Euler's method code.
You can use the below approach for implementing your problem clc clear all close all h=0.01; N=120; % number of steps ...

11 dagar ago | 0

Answered
Hold on and Hold off command keeps all plots on subsequent graphs
figure(1) fplot(eqn1,[0,4*pi]) hold on fplot(d_eqn1,[0,4*pi]) figure(2) fplot(eqn2,[-10,10]) hold on fplot(d_eqn2,[-10,...

12 dagar ago | 0

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
K=zeros(1,4100); L=zeros(1,4100); Check the size of vectors K and L

12 dagar ago | 0

Answered
How can I change the title of a figure through each iteration of the loop?
close all; clear variables; clc; % % For Phi/Psi = +/-10 CoverageArea_mean_10 = {[84.4735,21.1779,6.4247,2.1416],[45.2112,...

13 dagar ago | 0

Answered
How can I get a profit function P(x,y) using a cost function C(x,y) and a revenue function R(x,y)
x = 1; y = 1; % assume some input values R = @(x,y) 6*x.*y + x.^2; % use funciton handle to define the equations C = @(x,y)...

13 dagar ago | 0

Answered
How to make the condition for checking the matrix value ?
popnew1 = 2-A(mutated);

14 dagar ago | 0

| accepted

Answered
Value of the array in calculation and graph is different
format long k=10; Es=0.05; t=273; TempK=0:1500; cp=0:0.2:1.2; cp=0.99403+((1.671e-4)*(TempK))+((9.7215e-8)*(TempK.^2))-((9...

14 dagar ago | 0

Answered
Index exceeds the number of array elements. Index must not exceed 751.
M(n)=M(n)-(dM*dt);

14 dagar ago | 0

| accepted

Answered
how to solve error using horzcat dimensions of array being concatenated are not consistent
You can transpose the output of ode23 as follows y(j,:)= [i, x(:,1).']; % transpose col matrix plot(y,'r.'); drawnow

15 dagar ago | 0

Answered
The following error occurred converting from sym to double: Unable to convert expression containing symbolic variables into double array..
syms theta1 theta2 t=[0.01:0.1:10]; l1= 50; l2= 50; l3= 10; dt = 1; x2 = l1*cos(theta1) x3 = l2*cos(theta1+theta2)+ x2;...

15 dagar ago | 0

| accepted

Answered
Driving force of driven damped harmonic oscillator missing
c0=299792458; %speed of light lase_lambda = 1064e-9; %wavelength lase_freq = c0/lase_lambda; w0 = 2*pi*lase_freq; ...

16 dagar ago | 0

Answered
Analytical Solution of Double Integral in Symbolic Math
syms x a = 2; sol = int(sin(x).*(a.^2*cos(x).^2 + sin(x).^2/a).^(1/2),x,[0,pi]) vpa(sol) % use vpa

17 dagar ago | 0

| accepted

Answered
Plot title keeps rewriting on top in livescript
close all % add this line at begin x=linspace(0,5,100);

18 dagar ago | 0

| accepted

Answered
polar plot of n^2 = 1+g equation
About the 2nd equation, you can plot it straightforward by plugging values for variables g and theta theta = 0:pi/100:2*pi; % ...

18 dagar ago | 0

Answered
Simulink Port Dimensions Error
M = A.*T + B*Y %

18 dagar ago | 0

Answered
What is wrong here? The equation of a circle given its center
syms x y R e1=(x+1)^2+(y-3.2)^2==R^2; e2=(x+8)^2+(y-4)^2==R^2; e3=(x+6.5)^2+(y+9.3)^2==R^2; result=solve([e1,e2,e3],[x y R])...

18 dagar ago | 0

| accepted

Answered
Animate results from PDE toolbox
M(:,i) = getframe(gcf); % use gcf

18 dagar ago | 0

| accepted

Load more