Cannot Plot the graph, Matrix dimensions must agree for R and T
Show older comments
clear
clc
%% define variable
p = 500 * 10^3;
a = 0.2;
b = 0.25;
r = [0.2 : 0.005 : 0.25];
R = [-p * (a^2 / (b^2 - a^2)) * ((b^2 / r.^2) - 1)];
T = [p * (a^2 / (b^2 - a^2)) * ((b^2 / r.^2) + 1)];
figure(1)
plot(r, R, 'r')
figure(2)
plot(r, T, 'B')
Answers (1)
Sabyasachi
on 17 Oct 2022
0 votes
% This may help you.
p = 500 * 10^3;
a = 0.2;
b = 0.25;
r = 0.2 : 0.005 : 0.25;
R = -p * (a^2\(b^2-a^2))*((b^2\r.^2)-1);
T = p * (a^2\(b^2-a^2))*((b^2\r.^2)+1);
figure(1)
plot(r, R, 'r')
figure(2)
plot(r, T, 'B')
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!