Assign value to an array

조회 수: 11 (최근 30일)
Raúl
Raúl 2013년 3월 25일
Hi all,
I would like to assign a specific value to a specific position into an array.
The part of code where i'm getting error is:
y(0)= h2-0.36;
h2 is a double with value 0.8000
The error is:
??? Attempted to access (0); index must be a positive integer or logical.
Error in ==> Multipath_h1h2 at 20 y(0)= h2-0.36;
Thanks.
Raúl.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 25일
편집: Azzi Abdelmalek 2013년 3월 25일
The index must be positive integer or logical
Your are allowed to use
x(1),x(2),...
%or
x(logical(0)) and x(logical(1))
look at
  댓글 수: 1
Raúl
Raúl 2013년 3월 25일
It works,
Thanks Azzi.

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

추가 답변 (0개)

카테고리

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