I am having some issues calling a function in a script file.
Show older comments
At the moment I have a previously saved function, it as 7 inputs and 2 output. The 2 outputs are the inputs that I need to create 2 subplots with the output as my y, and the x being the index of these values. For example my function;
function[II,JJ]=RLC(R,L,C,tinc,n,ii,jj)
I need to call this RLC function in the first line of my script, but I can only call it. I can't redefine it, so no more code in regards to the RLC are to be present in the script. This is my script so far;
RLC(2,0.01,0.01,0.01,10,1,0);
subplot(1,2,1),plot(II)
axis([0,9,-25,15])
title({'\bf Plot of current in RCL series circuit';});
xlabel('Time stamp number n');
ylabel('Current in Amperes');
grid off
subplot(1,2,2),plot(JJ)
axis([0,9,-25,15])
title({'\bf Plot of current in RCL series circuit';});
xlabel('Time stamp number n');
ylabel('Numerical differential of current in Ampere/sec');
grid off
Even though this prints outputs II and JJ from the function to the command window, I can't use it in my plot. I have tried fplot as well but no luck.
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D 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!