Thread Subject: Body applied force decomposition

Subject: Body applied force decomposition

From: Tiago Marcilio

Date: 23 Nov, 2009 14:14:21

Message: 1 of 3

The code is displayed below
My problem is , I have to generate a table with all the entered variables and produced ones(by the loops) and display it at the with a graph of Rx and Ry.
Please if you have any idea how to do so It be very nice if you could share it with us.

% Body Applied force decompositon
clc
clear all
disp('Body Applied force decompositon')
disp('')
resp=1;
while resp==1;
g=9.8;
u=input('How many forces are involved = ');
if (u<0 | u>20);
    disp('this number cannot be negative');
else
        
mass=input('enter the body mass = ');
if mass<=0;
   disp('Negative mass isn't allowed');
        else
            p=mass*g;
            %fprintf('\Rx \t \Ry \n'); doesn't work appropriately
            %fprintf('%2.2f \t %2.2f \n',[Rx Ry]); doesn't work appropriately
    for k=1:u
        disp('')
        f=input('enter the force = ');
        disp('')
        if f<0
            disp('negative force isn't allowed');
        else
            if f==0
                disp('the orthogonal components of this one are null');
            else
                a=input('enter the horizontal angle formed = ');
                ard=a*pi/180;
                Rx=f*cos(ard);
                Ry=f*sin(ard);
                R=sqrt(Rx^2+Ry^2);
                %A=[Rx Ry]; doesn't work appropriately
                %for m=1:u ; doesn't work appropriately
                % fprintf('%2.2f \t %2.2f \n',[Rx Ry]);doesn't work appropriately
                %end doesn't work appropriately
            end
        end
    end
    m=u;
   % for m=1:u doesn't work appropriately
     % A1=[Rx Ry]; doesn't work appropriately
     % fprintf('%2.2f \t %2.2f \n',[Rx Ry]); doesn't work appropriately
     % soma=A+A1 doesn't work appropriately
    %end doesn't work appropriately
end
end
resp=input('wanna do more decompositions = ');
resp==2;
end
Thanks guys.

Subject: Body applied force decomposition

From: Tiago Marcilio

Date: 23 Nov, 2009 14:19:20

Message: 2 of 3

"Tiago Marcilio " <tiagomarcilio@gmail.com> wrote in message <hee5bt$ft3$1@fred.mathworks.com>...
> The code is displayed below
> My problem is , I have to generate a table with all the entered variables and produced ones(by the loops) and display it at the end with a graph of Rx and Ry.
> Please if you have any idea how to do so It be very nice if you could share it with us.
>
> % Body Applied force decompositon
> clc
> clear all
> disp('Body Applied force decompositon')
> disp('')
> resp=1;
> while resp==1;
> g=9.8;
> u=input('How many forces are involved = ');
> if (u<0 | u>20);
> disp('this number cannot be negative');
> else
>
> mass=input('enter the body mass = ');
> if mass<=0;
> disp('Negative mass isn't allowed');
> else
> p=mass*g;
> %fprintf('\Rx \t \Ry \n'); doesn't work appropriately
> %fprintf('%2.2f \t %2.2f \n',[Rx Ry]); doesn't work appropriately
> for k=1:u
> disp('')
> f=input('enter the force = ');
> disp('')
> if f<0
> disp('negative force isn't allowed');
> else
> if f==0
> disp('the orthogonal components of this one are null');
> else
> a=input('enter the horizontal angle formed = ');
> ard=a*pi/180;
> Rx=f*cos(ard);
> Ry=f*sin(ard);
> R=sqrt(Rx^2+Ry^2);
> %A=[Rx Ry]; doesn't work appropriately
> %for m=1:u ; doesn't work appropriately
> % fprintf('%2.2f \t %2.2f \n',[Rx Ry]);doesn't work appropriately
> %end doesn't work appropriately
> end
> end
> end
> m=u;
> % for m=1:u doesn't work appropriately
> % A1=[Rx Ry]; doesn't work appropriately
> % fprintf('%2.2f \t %2.2f \n',[Rx Ry]); doesn't work appropriately
> % soma=A+A1 doesn't work appropriately
> %end doesn't work appropriately
> end
> end
> resp=input('wanna do more decompositions = ');
> resp==2;
> end
> Thanks guys.

Subject: Body applied force decomposition

From: Tiago Marcilio

Date: 23 Nov, 2009 14:19:21

Message: 3 of 3

"Tiago Marcilio " <tiagomarcilio@gmail.com> wrote in message <hee5bt$ft3$1@fred.mathworks.com>...
> The code is displayed below
> My problem is , I have to generate a table with all the entered variables and produced ones(by the loops) and display it at the end with a graph of Rx and Ry.
> Please if you have any idea how to do so It be very nice if you could share it with us.
>
> % Body Applied force decompositon
> clc
> clear all
> disp('Body Applied force decompositon')
> disp('')
> resp=1;
> while resp==1;
> g=9.8;
> u=input('How many forces are involved = ');
> if (u<0 | u>20);
> disp('this number cannot be negative');
> else
>
> mass=input('enter the body mass = ');
> if mass<=0;
> disp('Negative mass isn't allowed');
> else
> p=mass*g;
> %fprintf('\Rx \t \Ry \n'); doesn't work appropriately
> %fprintf('%2.2f \t %2.2f \n',[Rx Ry]); doesn't work appropriately
> for k=1:u
> disp('')
> f=input('enter the force = ');
> disp('')
> if f<0
> disp('negative force isn't allowed');
> else
> if f==0
> disp('the orthogonal components of this one are null');
> else
> a=input('enter the horizontal angle formed = ');
> ard=a*pi/180;
> Rx=f*cos(ard);
> Ry=f*sin(ard);
> R=sqrt(Rx^2+Ry^2);
> %A=[Rx Ry]; doesn't work appropriately
> %for m=1:u ; doesn't work appropriately
> % fprintf('%2.2f \t %2.2f \n',[Rx Ry]);doesn't work appropriately
> %end doesn't work appropriately
> end
> end
> end
> m=u;
> % for m=1:u doesn't work appropriately
> % A1=[Rx Ry]; doesn't work appropriately
> % fprintf('%2.2f \t %2.2f \n',[Rx Ry]); doesn't work appropriately
> % soma=A+A1 doesn't work appropriately
> %end doesn't work appropriately
> end
> end
> resp=input('wanna do more decompositions = ');
> resp==2;
> end
> Thanks guys.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com