how to write long field name in a shape file?
Show older comments
Hello everyone , I need to write new column in a shape file so I used setfield function
SumOfLightColumn=strcat('Sum','20150201_20150228');
SumOfLightColumn=char(SumOfLightColumn);%%convert it to character because it is a cell araay
shapeToTable=struct2table(shape);
n=num2cell(a); %%convert the a column vector from double to cell array so i can write in the table
s=setfield(shapeToTable,SumOfLightColumn,n); %%n is a after convertion to a cell array
w = table2struct(s);
shapefile1=fullfile(shapeFolder,baseShape); %%this the the path of the shape file
shapewrite(w,shapefile1);
but the output of the field name is :Sum20150201 and when I run it for the second time it writes another column :Sum201502011 it doesn't take the whole name like this :Sum20150201_20150228
Does anyone know how to fix this? the attachment is a screenshot of the output shape file
Accepted Answer
More Answers (0)
Categories
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!