CODE: clc clear all close all x=input('Enter the first array'); h=input('Enter the second array'); z=[]; for i=1:length(x) g=h.*x(i); z=[z;g]; end [r c]=size(z); k=r+c; t=2; y=[]; cd=0; while(t
This method is used to store array in it's next row ...for example z=[ ]; Now , g=1; z=[z;g]; After execution of this line , z=1; now suppose g=2; then if we execute z=[z;g]; then--> z=1 2 That means the element is stored in the next row . In this case , g has to be stored in next rows everytime...so that I have written that :-)
Knowledge Amplifier what is the need of jumping to next row using z[z;g] because as the value of loop variable i changes it will automatically be place in new row
@@thelight8 Now the question is why this is happening ? You are correct that"... as the value of loop variable i changes it will automatically be place in new row " but this is only applicable if we give index position like z(i,j) ....otherwise it will not work as you have seen too :-) Hope you understand the reason
CODE:
clc
clear all
close all
x=input('Enter the first array');
h=input('Enter the second array');
z=[];
for i=1:length(x)
g=h.*x(i);
z=[z;g];
end
[r c]=size(z);
k=r+c;
t=2;
y=[];
cd=0;
while(t
Thank you so much for your good illustrations. /Iraq
You are Welcome . Happy Coding :-)
Thanks, this video helped me a lot
Glad to know the video helped you Parsa Mohammadi! Happy Learning :-)
But how cd is storing all the values?
First cd stores 1 then in next loop it has to store 2+2=4 and cd already had 1,cd=cd(1)+4=5.
Hey hope you're doing well?I don't understand very well english , i wantef to ask you what is cd and why we derminate it to 0?
Thanks! I love the explanation!
Thank You Alejandra Cardona . Happy Coding :-)
what is cd? and why did we define it as 0
Thanks buddy😊
Helps alottt
Thank you for sharing this. You have my like.
Thank You for liking , it motivates us to work harder Cap'n Nemo! Happy Learning :-)
Thanks bro🤯🤯🤯🤯🤯
Welcome sai chaitanya! Happy Learning :-)
@@KnowledgeAmplifier1 thanks sir! Im very grateful to you sir
Hi how are u ?I need your help please
Hi , Dilveen , I am fine . How do you do ? Tell me about your problem
Z=[Z; g] plz explain clearly
This method is used to store array in it's next row ...for example z=[ ];
Now , g=1;
z=[z;g];
After execution of this line , z=1;
now suppose g=2;
then if we execute z=[z;g]; then-->
z=1
2
That means the element is stored in the next row .
In this case , g has to be stored in next rows everytime...so that I have written that :-)
Knowledge Amplifier what is the need of jumping to next row using z[z;g] because as the value of loop variable i changes it will automatically be place in new row
@@thelight8 No , you can not go to next row using that . Check in matlab
Knowledge Amplifier yes i already done that . You r right
@@thelight8 Now the question is why this is happening ?
You are correct that"... as the value of loop variable i changes it will automatically be place in new row " but this is only applicable if we give index position like z(i,j) ....otherwise it will not work as you have seen too :-)
Hope you understand the reason