Issue loading mat file in different MATLAB versions

3 views (last 30 days)
I have a mat file which contains userInputs that has 24 fileds. when i load in MATLAB 2023b i gives struct field userInput.SignalSourceType as empty but when i load same file in MATLAB 2024b i givest struct field userInput.SignalSourceType as 1. I am attaching screenshot for reference. The difference cause further issues and errors in my code and i need to run it on 2024b for certain requirments. If anyone have resolution please help me out.

Answers (1)

Rik
Rik on 21 Jan 2025
Without the mat file, it is impossible to tell what type of object gets loaded in R2023b. It looks as if it gets loaded as an empty double array in R2024b.
You need to call class(userInput.SignalSourceType) and make sure that is supported in your copy of R2024b as well.
  4 Comments
Rik
Rik on 22 Jan 2025

I'm on mobile so I can't run code now.

As Walter clarified, it seems your copy of 23b supports a class that your copy of 24b doesn't. Calling the class function will not solve the problem, but it will tell you the class name.

So what was the result? And how did you make sure that class is also supported in your copy of 24b?

Walter Roberson
Walter Roberson on 22 Jan 2025
When I load in R2023b I get
SignalSourceType: Captured
which is an enumeration. It is not immediately clear why the enumeration would not be considered properly in later versions.
I also get the message
Warning: Could not find appropriate function on path loading function handle \\fs-58-ah\vmgr$\home08\kkearney\Documents\MATLAB\Examples\comm-ex67942163\helperAISController.m>generateCodeCallback
but I get that for both R2023b and R2025a

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!