Generate input
%[data, text, alldata] = xlsread('C:\Users\hze1\Desktop\Descrete Choice Models\final_file_b.xls','Data','A1:GG25831');
data = [2 4;1 12;23 121];
s = size(data);
%FIPS = zeros(s(1),1);
filename0=('C:\Users\hze1\Desktop\Descrete Choice Models\FIPS.dat');
for i=1:s(1)
if length( num2str(data(i,1)))<2
temp1 = strcat('0', num2str(data(i,1)))
else
temp1 = num2str(data(i,1))
end
if length( num2str(data(i,2)))<2
temp2 = strcat('00', num2str(data(i,2)))
elseif length( num2str(data(i,2)))== 2
temp2 = strcat('0', num2str(data(i,2)))
else
temp2 = num2str(data(i,2))
end
FIPS{i} = strcat(temp1 , temp2)
end
%result should be : [02004;01012;23121]
%save (filename0, 'FIPS', '-dat');
Cite As
Hamideh (2026). Generate input (https://www.mathworks.com/matlabcentral/fileexchange/35470-generate-input), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
