Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Undefined function or variable 'anualanomalie'

조회 수: 1 (최근 30일)
João Carvalho
João Carvalho 2017년 10월 30일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a function that gives the average of 136 values that are in a column of a text file (Image 2) and I want to show that average to the user in the command window.
But when I run the program it says: "Undefined function or variable 'anualanomalie'. " (Image 1)
Also, load1 is another function (Image 3).
What can I do? Where is the problem? Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2017년 10월 31일
When you call a function that has outputs, you need to store the outputs into variables if you want to use them. A syntax such as
function [A, B] = testfunction
does not result in A and B being stored in the caller: it tells MATLAB to use A and B to "stand in" for whatever output variables that the user is assigning the values to.
We recommend that you do not use "sum" as the name of a variable: you will almost certainly eventually try to use sum() as a function in the same routine that you used sum as a variable.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by