function modifiedReadings = CalibrateReadings(originalReadings, adjustVal)
% originalReadings: Array of temperature readings
% adjustVal: Value added to each element in the array of temperature readings
% Add adjustVal to each element of array originalReadings
modifiedReadings = [originalReadings adjustVal]
end

댓글 수: 5

John D'Errico
John D'Errico 2017년 10월 2일
Why do you think there is something wrong?
Blair Hall
Blair Hall 2017년 10월 2일
I do not know. That is what matlab says.
per isakson
per isakson 2017년 10월 2일
  • How did you call the function?
  • Show the full error message.
Blair Hall
Blair Hall 2017년 10월 2일
here it is
@Blair: You get the message, that for the input
[51, 53, 61, 62]
the output of your function is
[51, 53, 61, 62, 1]
but the wanted output is
[52, 54, 62, 63]
The instruction was to "add a value to the elements of the input". And than you ask in the forum? Something is going really wrong here.
Do you have problems to understand the meaning of the question? Then a Matlab forum is not the right location to solve this. The forum will not solve all these very basic questions for you, because this is your homework (or job, or interest).

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

 채택된 답변

Jan
Jan 2017년 10월 2일
편집: Jan 2017년 10월 2일

0 개 추천

The instructions are clear:
Add adjustVal to each element of array originalReadings
"add" means the + operation, not a concatenation with the square brackets.
This problem is very basic. Usually the members of the forum ask problems concerning Matlab functions and algorithms. But here it seems to me, like the problem is the understanding of English. Is it a problem of the language?
I don't know, what an "arithmetic array" is.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2017년 10월 2일

댓글:

Jan
2017년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by