English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

hey guys, just need some help with one assignment... im not asking you to do it for me, just point me in the right direction. i need to make a simplelogin system, with a username and password which will be compared with a matrix of valid usernames and passwords. there are other points to the assignment, but ill figure those out once i get a good start. could someone recommend a good resource or tutorial? thanks alot in advance :) the problem is that im a complete beginner... i can barely carry out simple calculationsin matlab....

2006-10-08 10:54:21 · 2 answers · asked by SpankmasterFlex 2 in Computers & Internet Programming & Design

2 answers

Use the "input" function to prompt the user for their username and password.

I would recommend storing usernames and passwords in separate matrices, if the assignment allows it. If not, then you can form a matrix with one "column" storing usernames and one storing passwords. In reality, the first N columns hold the usernames, where N is the length of the longest username.

To do the comparison: for each row in the matrix, extract the username and/or password. Use the deblank function to remove any trailing blanks before you compare, because a matrix of strings requires that all rows have the same number of columns, meaning short strings have to be padded.

Use the strcmp function to perform the comparison.

One Matlab resource, written by the creator of Matlab, is listed below.

2006-10-08 11:07:29 · answer #1 · answered by James L 5 · 0 0

Just a note: In the real world passwords are not stored plain-text and entries are not compared to actual passwords. The storage is encrypted, and a special checksum is calculated from the encrypted password, and compared with the checksum from the entered password.

No REAL operating system has a plain-text file of passwords.

-mm

2006-10-09 12:30:13 · answer #2 · answered by Curly 6 · 0 0

fedest.com, questions and answers