I want to plot a integral expression but it shows error as "Incorrect dimensions for raising a matrix to a power. Check that the matrix is square" Kindly help me out

1 view (last 30 days)
clear all
clc
syms t hw
sigma=8.41/1000000;
A=4*10^(-14);
C=1.2404e+08;
hw=[2:0.02:9];
t=int((1/((C/sigma)*((sigma*hw)^3+(A)))),hw,0,hw);
plot(hw,t,'bo')
  3 Comments
venkatesu u
venkatesu u on 15 Sep 2021
Edited: venkatesu u on 15 Sep 2021
I have used (sigma*hw).^3 instead of (sigma*hw)^3, but follwing error was displayed "Error using / Matrix dimensions must agree." Kindly help me out
Konrad
Konrad on 15 Sep 2021
Same issue. Use
1./((C./sigma).*...)
I'm not very familiar with the symbolic math toolbox, but are you sure you got that right? Maybe you don't need the syms but want numerical integration? Then take a look at integral()

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 15 Sep 2021
syms hw
sigma = 8.41/1000000;
A = 4*10^(-14);
C = 1.2404e+08;
t = int((1/((C/sigma)*((sigma*hw)^3+(A)))),hw,0,hw);
HW = [2:0.02:9];
T = double(subs(t, HW));
plot(HW, T, 'bo')

Tags

Community Treasure Hunt

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

Start Hunting!