Cannot Plot the graph, Matrix dimensions must agree for R and T

조회 수: 1 (최근 30일)
Felis Flora
Felis Flora 2022년 10월 17일
답변: Sabyasachi 2022년 10월 17일
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')

답변 (1개)

Sabyasachi
Sabyasachi 2022년 10월 17일
% 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')

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by