On 10/25/2012 12:36 AM, lady firmament wrote:
> v1=0.0001;v2=-0.0001;vp=-1:1;
> Fc_p=57;Fc_n=28:Fs_p=175;Fs_n=110;s2_p=130;s2_n=130;
> if vp>=0
> if vp>=v1
> Fr=Fc_p+s2_p*vp
> else
> Fr= vp/v1*Fc_p
> end
> else
> if vp<=v2
> Fr=vp/v2*Fc_n
> else
> Fr=Fc_n+ s2_n*vp
> end
> end
> plot(vp,Fr)
> I wanna plot above program for (coulomb + viscous friction) . But The program
>cannot connect the term( Fr= Fc_p+ s2_p*vp). Is my declareation wrong ? Is there anyone to help me?
>
why not use Matlab code analyzer?
2: Parse error at '=': usage might be invalid MATLAB syntax.
3: Variable 'vp' might be set by a nonscalar operator.
4: Variable 'vp' might be set by a nonscalar operator.
5: Terminate statement with semicolon to suppress output (within a script).
7: Terminate statement with semicolon to suppress output (within a script).
10: Variable 'vp' might be set by a nonscalar operator.
11: Terminate statement with semicolon to suppress output (within a script).
13: Terminate statement with semicolon to suppress output (within a script)
> v1=0.0001;v2=-0.0001;vp=-1:1;
> Fc_p=57;Fc_n=28:Fs_p=175;Fs_n=110;s2_p=130;s2_n=130;
> if vp>=0
> if vp>=v1
> Fr=Fc_p+s2_p*vp
> else
> Fr= vp/v1*Fc_p
> end
> else
> if vp<=v2
> Fr=vp/v2*Fc_n
> else
> Fr=Fc_n+ s2_n*vp
> end
> end
> plot(vp,Fr)
> I wanna plot above program for (coulomb + viscous friction) . But The program
>cannot connect the term( Fr= Fc_p+ s2_p*vp). Is my declareation wrong ? Is there anyone to help me?
>
why not use Matlab code analyzer?
2: Parse error at '=': usage might be invalid MATLAB syntax.
3: Variable 'vp' might be set by a nonscalar operator.
4: Variable 'vp' might be set by a nonscalar operator.
5: Terminate statement with semicolon to suppress output (within a script).
7: Terminate statement with semicolon to suppress output (within a script).
10: Variable 'vp' might be set by a nonscalar operator.
11: Terminate statement with semicolon to suppress output (within a script).
13: Terminate statement with semicolon to suppress output (within a script)