Info
此问题已关闭。 请重新打开它进行编辑或回答。
using one ratio value,how to search values which are the same in magnitude in one arry,and the same posion in the thrid arry?
1 次查看(过去 30 天)
显示 更早的评论
I have two raw vectors m and n of equal length 10.The user feeds two raw vectors h and t of unknown length.My code use the ratio of h to t(let say h./t=k) and searches if there is an equal value in n which is the same as k .If it finds the value in n,which is =k,it should use the value m which corresponds in the same position in n.
eg m=[0.1406 0.166 0.196 0.229 0.249 0.263 0.281 0.291 0.312]; n=[1.0 1.2 1.5 2.0 2.5 3 4 5 10 ]; h= [ 2a b c a 3b] t= [a l 1 b]
k=h./t =[2 b c 3]
then k= 2 and 3 are found in n.The values in m which are corresponding to 2.0 and 3 will be used that are(m(4) and m(6)index 4 and 6 are needed since they are the same for n an m for my code. Help me guys as usual how can i write the code?It may simple for you,but it confused me.
Is there any way I can use the same index for more than two vectors
eg J=k(i).*h(i).*t(i).^3 is it possible?
0 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!