How do I create a user modified profile database?
Ältere Kommentare anzeigen
How do I create a user (profile name) updated database that updates everytime a new name is added, and will also allow the user to erase their profile if needed? This information will be used to title and store excel data and personal data.
4 Kommentare
Geoff Hayes
am 22 Mär. 2015
George - how is this a MATLAB question? Are you creating a MATLAB GUI that will allow a user to create a profile that you wish to save to some database using SQL or is it much simpler and you just want to save this information to file? Please provide more details.
George
am 22 Mär. 2015
Geoff Hayes
am 22 Mär. 2015
George - please post your code so that we can provide some guidance.
George
am 22 Mär. 2015
Bearbeitet: Geoff Hayes
am 22 Mär. 2015
Antworten (1)
Geoff Hayes
am 22 Mär. 2015
George - you should check out the link debugging in MATLAB as it will provide some very useful tips on how to debug your code.
If I try to run the above as a new user, then once I type in my name, the following error message appears
Undefined function or variable "index".
because of the line of code
profile_names{index} = user_name;
The local variable index is only ever assigned if the user does not enter Y or N and the body of the while loop is invoked. (As an aside when comparing string data, use strcmpi or strcmp instead of the equality or inequality operators.) It isn't clear to me why index is assigned in this loop - it seems very unnecessary. Instead, just use counter as
if strcmpi(userinput,'y')
user_name = input('\n\nplease enter name: ','s');
profile_names{counter} = user_name;
counter = counter + 1;
else
old_profile = input('Please enter name of profile: ','s');
end
Now try doing something similar for the else body in the above code (which presumably is meant to remove the user account).
1 Kommentar
George
am 25 Mär. 2015
Kategorien
Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!