How do i use any numeric value as a symbol?

I want to create a program for arranging group of students according to their percentage marks.I want to assign their marks to their respective roll numbers,e.g 4580=80%,4511=67.32% etc. How can i do this??

Answers (2)

s='4580=80%'
If it's not what you are looking for, please be more clear

1 Comment

Thanks Azzi, This is not what i am looking for.. Let us assume there is group of 5 students having roll nos. 4510 4511 4512 4514 & 4516 having marks 71,76,74,80 & 81 respectively. I have excel data containing this info and i am importing this to Matlab. Now I just want to take average of percentage by mentioning roll no. like (4510+4511+4512+4514+4516)/5=76.40 i.e avg of 71,76,74,80 & 81.

Sign in to comment.

Numbers are numbers and you cannot assign anything to them. But you can use a struct array, to store both information:
S(1).name = '4580'
S(1).result = 0.8
S(2).name = '4511'
S(2).result = 0.6732
...

Categories

Asked:

on 23 Jul 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!