필터 지우기
필터 지우기

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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by