필터 지우기
필터 지우기

Write Without using loop

조회 수: 1 (최근 30일)
Ls
Ls 2021년 8월 12일
댓글: Image Analyst 2021년 8월 15일
calculation of equations without using loop
  댓글 수: 2
Wan Ji
Wan Ji 2021년 8월 12일
You need to give the equations and then people would help you
Image Analyst
Image Analyst 2021년 8월 15일
@Ls. Below is a screenshot of your question I just took. Where exactly on that do you show the equation? Because we're not seeing it.
Do YOU see any formulas or equations above? Because I sure don't.

댓글을 달려면 로그인하십시오.

답변 (1개)

Chunru
Chunru 2021년 8월 12일
Not sure if you have given the correct equations:
% Specify n, t and x
n = 10;
t = (1:n)'; x = randn(n, 1); % generate some data
% Initialize vx and ax
vx = zeros(n, 1);
ax = zeros(n, 1);
% vx(1) and ax(1)
vx(1)=(x(1)-x(n-1))/(t(n)-t(n-1)); % check your equations
ax(1)=(vx(1)-vx(n-1))/(t(n)-t(n-1)); % check your equations
for i=2:n
vx(i)=(x(i)-x(i-1))/(t(i)-t(i-1));
ax(i)=(vx(i)-vx(i-1))/(t(i)-t(i-1));
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by