Store user input data into matrix
이전 댓글 표시
Hello, I'm trying to store new user input data into matrix and export that data to excel, but I couldn't find the way to do it. Can anybody help me???
close all;
clear all;
clc;
n=2;
while(1)
filename='data';
A={'Vehicle model number','Vehicle purpose','Vehicle registration number','starting year of registration','ending year of registration', 'owner'};
fprintf(' *programme name* \n')
fprintf('---------------------------\n')
fprintf('1) car registration \n')
fprintf('0) close the programme \n')
fprintf('---------------------------\n')
m=input('enter the choice : ');
if m==1
fprintf(' *1) car registration \n')
fprintf('---------------------------\n')
number=input('- Vehicle information number :','s');
year=input('- starting year of registration(year) :');
period=input('- registration period(year) :');
owner=input('- owner :','s');
Anew={number(1:3),number(4),number(5:8),year,year+period,owner};
A(n,1)=num2cell(Anew(1,1));
A(n,2)=num2cell(Anew(1,2));
A(n,3)=num2cell(Anew(1,3));
A(n,4)=num2cell(Anew(1,4));
A(n,5)=num2cell(Anew(1,5));
A(n,6)=num2cell(Anew(1,6));
n=n+1;
end
if m==0
break;
end
xlswrite('data',A);
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!