I have a homework due on 06/30/2015
The question is to write a code does the following: given an excel file contains social security number of city.a) I need only to select five ssn from 1000 to 6000 .
b) the output should be:
Ssn:1000s=1
Ssn:2000s=2
Ssn:3000s=3
Ssn:4000s=4
Ssn:5000s=5
C) the total # of habitants in tinu ville is 5
Please any help . i can't figure out by my self

5 commentaires

Romil Shah
Romil Shah le 28 Juin 2015
Can you be more specific as to you need to select randomly or specific 5 ssns?
Paulin Bangofa
Paulin Bangofa le 28 Juin 2015
Yes just random number in the variable that contains the sssn. This one in my question is an example how the output should look. Please help
Paulin Bangofa
Paulin Bangofa le 28 Juin 2015
Help please
Image Analyst
Image Analyst le 28 Juin 2015
You have not given us much to help on. For example why are you asking about social security numbers in the range 1000-6000. In the US social security numbers are in the form nnn-nn-nnnn so I don't know what it means when you say 1000 to 6000.
Paulin Bangofa
Paulin Bangofa le 28 Juin 2015
Modifié(e) : Paulin Bangofa le 28 Juin 2015
The question is i have a excel file contains the social security number for each individual living in that villr where all ssn's range (1000 6000). I have to import the excel file into matlab

Connectez-vous pour commenter.

Réponses (1)

Geoff Hayes
Geoff Hayes le 28 Juin 2015

0 votes

Paulin - use xlsread to read the data from the Excel spreadsheet. Presumably there are multiple columns of data within this file (city name, social security number, etc.) so you will have to figure out which column is the one that you are interested in. Once you have extracted that column, you can probably sort the data and then randomly choose five whose number is within the desired range.

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by