i want to build a database with column and rows

조회 수: 3 (최근 30일)
Bikash
Bikash 2014년 4월 16일
답변: Bikash 2014년 4월 20일
The table should have fields
NAME .... AGE .. SALARY
ashok .... 23 .....2300
john ..... . 34 .... 3400
horis ..... 40 .... 6700
and salary is a variable 'n' which changes the salary in the database ,when n gets the value in the command window and update the database .Please suggest
  댓글 수: 1
Alberto
Alberto 2014년 4월 16일
I suggest to code your data as as a struct. For example:
D.id(1).Name= 'asrock'
D.id(1).Age= '23'
D.id(1).Salary= '2300'
D.id(2).Name= 'john' ...
I think its really confortable like this.

댓글을 달려면 로그인하십시오.

채택된 답변

Mischa Kim
Mischa Kim 2014년 4월 16일
편집: Mischa Kim 2014년 4월 16일
Bikash, use table, e.g.,
NAME = {'ashok';'john';'horis'};
AGE = [23;34;40];
SALARY = [2300;3400;6700];
T = table(NAME, AGE, SALARY)

추가 답변 (1개)

Bikash
Bikash 2014년 4월 20일
Thanks !

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by