I want to store user inputs in an array, but when a person enters a new number, the previous input gets replaced. How can I create such an array in Matlab such that I can store all inputs without replacement? I am a beginner so bear with me
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You simply need to copy the contents of the input buffer into a data struct that won’t be overwritten.
Cell arrays are good for that (see the
userInputsvariable below) . Without better knowledge of your code, I’m guessing the user input is stored in a variable namedbuffer. Here’s how I would do it:Good luck!