[討論] 請問可以用for指令達到按次序除嗎

作者: newdas (.)   2014-06-03 22:13:49
大家好 想問大家如果用for指令
可以達到 固定除於同樣行數嗎
例如 分子為 [1 3 5 7 9 10]
分母為 [2 7]
如何達到 [1/2 3/7 5/2 7/7 9/2 10/7]
按次序相除呢
感謝指點
作者: celestialgod (天)   2014-06-03 22:20:00
a=1:2:10; b=[2,7]; a ./ repmat(b, 1, 3)a=[1:2:9, 10]

Links booklink

Contact Us: admin [ a t ] ucptt.com