DEar Devilwar,
Thanks for your kind help.
One program that i tried y'day by myself is to plot xdot=sinx, with xdot along y axis and sinx along x axis but i'm getting error which is perhaps bcoz of error in logic hence want ur help in the same.
clc;
clear all;
function xdot = func(t,sinx);
xdot = sinx;
I saved it as func.m
in command prompt i typed
>>tspan = [0,2];x0=0;
>>[t,sinx]=ode23('func',tspan,x0);
here i'm getting error
Error: File:func.m Line:4 Column:1
Function definitions are not permitted at the prompt or in scripts.
Error in ==> odearguments at 81
if(nargin(ode)==2)
Error in ==>ode23 at 172
[neq,tspan,ntspan.....
One more thing i need to ask you is if it is necessary to have the function name and m file name to be the same as that is what i have seen in Rudra Pratap's book to be kept as same.
Regards,
Rahul