Hello, I read and text scanned a text file into a variable. This variable (1×2 cell) now contains 2 cell arrays each of these cell arrays is a 31×1 cell. One of them contain the names and the other the values. how do I assign each name to its corresponding value? Here is my code but its not working:
clear all;clc;PVData = 'w:\Users\james\Documents\MATLAB\readfile.txt';fid=fopen(PVData);PVRead=textscan(fid,'%s %f %*[^\n]','delimiter','=','EmptyValue',nan);fclose(fid);names = PVRead(1);values = PVRead(2);structarray = cell2struct(values, names, 2);
Best Answer