Quantcast
Channel: Classical Physics
Viewing all articles
Browse latest Browse all 57941

Help with plotting a graph in MATLAB

$
0
0
Hi,
I am trying to plot a graph representing the discharge of a capacitor in MATLAB, having defined the following function:

function f = discharge (x,a)
f = a(1) + a(2)*(exp(-x/a(3)));

Problem is, when I plot the initial function, the data seemingly don't fit at all! However, when I plot the data as are, without the function, they do appear to be valid.
I have no idea what might be causing this discrepancy and would truly appreciate some assistance.

Viewing all articles
Browse latest Browse all 57941

Trending Articles