Why doesn't my plot turn out the way it should?
Show older comments
I have been stuck at this for hours and i can't figure out what's the issue. Would be glad if anyone here can enlighten me!
clc
clear
%creating matrices for Solid-State Rate and Integral Expressions for Different Reaction Models
syms a t
M = [2*a^(1/2), 3*a^(2/3), 4*a^(3/4)];
K = 1./M;
I = int(K);
%making alpha the subject of the equation
eqn(1) = (I(1) == t);
v_a = solve(eqn(1), a);
%plotting alpha against time
t = linspace(0,10,1000);
fplot(t, v_a);
xlabel('t');
ylabel('f(x)');
title('Plot of the f(x)');
So is my code and the issue is that i can't get the shape of the plot out right. The expression for v_a is correct, but the plot isn't. Help!!
2 Comments
Kevin Chng
on 7 Oct 2018
Edited: Kevin Chng
on 7 Oct 2018
Hi,
i'm not sure whether i can help you or not.
clc
clear all
%creating matrices for Solid-State Rate and Integral Expressions for Different Reaction Models
syms a t
M = [2*a^(1/2), 3*a^(2/3), 4*a^(3/4)];
K = 1./M;
I = int(K);
%making alpha the subject of the equation
eqn(1) = (I(1) == t);
v_a = solve(eqn(1), a);
%plotting alpha against time
% t = linspace(0,10,1000);
fplot(v_a,[0 10]);
xlabel('t');
ylabel('f(x)');
title('Plot of the f(x)');
Is it the shape you want? I guess you might confuse to use fplot.
cubehz94
on 7 Oct 2018
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!