Cell contents reference from a non-cell array object.

조회 수: 1 (최근 30일)
John Callahan
John Callahan 2012년 7월 12일
Hello,
Sorry if this question has been asked before. I tried to find an answer on my own before I came here and was unsuccessful. Here is the story.
I wrote some code and a GUI to work with it. I can call an object called mortFinData just fine. I can also call the method colSwitch within it and pass any two doubles in.
ex. objExample.colSwitch(1,2); works just fine. if dub1 and dub2 are both doubles then objExample.colSwitch(dub1, dub2); works just fine as well.
When I run my gui and I hit a button called switchButton I hit this error:
Cell contents reference from a non-cell array object.
Error in mortFinData/colSwitch (line 361) tempCell = obj.finFile{1,col1};
Error in basicGui>switchButton_Callback (line 1173) linkedObject.colSwitch(switchColOne, switchColTwo);
To try to debug this I had it display switchColOne and switchColTwo before it called colSwitch to confirm they were both doubles. They were.
I don't quite understand where this error is coming from. If anyone could help me out it would be much appreciated.
-John.

채택된 답변

John Callahan
John Callahan 2012년 7월 12일
편집: John Callahan 2012년 7월 12일
Turns out the answer was simple. The error lies in my global variables. It would seem that all of the objects properties were empty :O! I'm going to open a new question if I can't figure out why :P

추가 답변 (1개)

Image Analyst
Image Analyst 2012년 7월 12일
Apparently obj.finFile is not a cell. Maybe it's a method or an array. Try it with parentheses instead of braces:
obj.finFile(1,col1);
  댓글 수: 1
John Callahan
John Callahan 2012년 7월 12일
That does not work. I get an Index exceeds matrix dimensions instead. It should still be a cell array. I don't understand why it wouldn't be. Also when referenced directly from the command window the parentheses don't work either.
Thank you for trying though. I can use any help people are willing to offer.

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by