i have trouble with load.it change matrix size.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
hi. i wrote a script that i use a loop in it for reading multiple image ( actually they are matrix with .data format). i have load function in this loop. my matrix is 730*13764 but when loaded by load function it changes to 730*1734 and my proccess stoped. what can i do? please help. it's for thesis.
3 Kommentare
dpb
am 2 Sep. 2021
We can't do anything useful with images -- attach the pertinent code as text itself so we can read/edit/fiddle...
Again I'll reiterate -- post the result of
whos -file YOURFILENAME
will be much more informative -- that'll tell you what the array size really was when it was save.
In a glance at the images I didn't see any load statement at all; I did see that you appear to have hardcoded in array sizes at the beginning of the function. This is poor practice and will, as you've seen, result in fragile code that won't work for data sets other than that specific size instead of being generic code to make a particular type of analysis on an input array of whatever size it might be.
If it MUST for some reason be that size, then your job will be to make sure it is before you get that far by whatever means you must...but that's probably not the ideal solution; the better route would almost certainly be to write the code to handle different size arrays automagically.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!