Error using ~= Matrix dimensions must agree during using while function
Mostra commenti meno recenti
I was testing the while loop for my ATM script.
password = 'jjteam'
password =
ucsdmate
balance = num1str(9.5405*100,'%10.2f%')
lastlogindate = datenum(2014,11,2,11,7,39)
lastlogindate =
7.3591e+05
datestr(lastlogindate)
rate = num2str(0.02*100,'%5.2f%%')
I save above code as atm.mat.
load ('atm.mat')
inpass = input('Enter your password : ','s');
while inpass ~= mypassword
disp('The passwoard is wrong,please try again.')
inpass = input('Enter your password : ','s');
end
fprintf('Your password is right.\n')
However, when I try to test my script, it said Error using ~= Matrix dimensions must agree. And Error in atm ,while inpass ~= mypassword. I am not sure which part I did wrong. Can anyone point it out? Thanks
Risposta accettata
Più risposte (1)
Julia
il 4 Nov 2014
0 voti
Hi,
I don't see where you use "mypassword". You declare only the string "password".
Categorie
Scopri di più su Large Files and Big Data in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!