Info

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

Having problems with functions

조회 수: 1 (최근 30일)
Ian Phillips
Ian Phillips 2012년 12월 11일
I've built a function, which I'm giving three values x, y and a. however when I run it I get the following error:
??? Reference to a cleared variable a.
Error in ==> parallel_inverse at 68
a = a * pi/180;
This is my function start:
function parallel_inverse(x, y, a)
Does anyone know why I'm getting this error?
  댓글 수: 4
Matt J
Matt J 2012년 12월 11일
편집: Matt J 2012년 12월 11일
Well, the error message is saying that you cleared the variable "a" somewhere prior to where you try to use it in the line
a = a* pi/180
If you don't want to show your code, then you'll have to go hunting for the clear statement yourself.
Ian Phillips
Ian Phillips 2012년 12월 11일
Thanks. I found the problem. first two lines in the function are:
clear;
clc;

답변 (0개)

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

Community Treasure Hunt

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

Start Hunting!

Translated by