フィルターのクリア

how to find division of two consecutive number of matrix without using for loop?

2 ビュー (過去 30 日間)
chirag patel
chirag patel 2020 年 2 月 12 日
編集済み: KSSV 2020 年 2 月 12 日
suppose i am using below matrix and method to find c
a= [1 2 3 4 5 6 7 8 9]';
c= a ./ a;
but i want c in the following way
c= a(i-1)/ a(i);
i know using for loop it can be done but i can't use for loop in ode45;

回答 (1 件)

KSSV
KSSV 2020 年 2 月 12 日
編集済み: KSSV 2020 年 2 月 12 日
a= [1 2 3 4 5 6 7 8 9]';
iwant = a(1:end-1)./a(2:end)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by