Turning a double array into a cell array in a big program
Show older comments
Hello. I am a fledgling programmer and I have been writing a big program (for me) for a few weeks now and I have realized that one of my main input arguments within my functions needs to be changed into a cell array. I decided this was probably the right decision because I want to reduce my input arguments to just a few variables instead of several. The problem here is that I have a double array and strings that need stored, so I thought a cell array would be the best option (I also thought about a structure but that would make my issue a lot worse).
This would be no problem, but I have already written 60 or 70 functions that all use this input argument as a double array. When I have had issues similar to this in the past, I would usually just CTRL+F and replace all. The issue here is that it would not be very fun to go through and change 250+ calls for a variable. As far as I know, I would have to be really tedious with CTRL+F because my understanding of indexing cell arrays uses {#} instead of (#) like a normal array. I don't know of a way to extend my CTRL+F into more than just the file I have open, and I don't know how to 'replace all' but leave the matrix indeces.
I don't have a lot of Matlab experience, but so far I have been able to find all the answers to my questions in the Matlab documentation and here in the answers section. I am writing this program with the purpose of learning more about Matlab and programming in general, so I don't fully understand the terminology yet. My only real experience with Matlab in an academic setting is Differential Equations and introductory zyBooks Matlab course.
I would be really grateful for any advice on mass-replacing and/or any tips on cell arrays vs. double/string arrays.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!