Matlab — Konvertierung zu double aus Zelle ist nicht möglich

Kann mir jemand sagen warum ich diese Fehlermeldung --
??? Der folgende Fehler ist aufgetreten Umwandlung von Zelle zu
Doppel:
Error using ==> doppelt
Konvertierung zu double aus Zelle ist nicht möglich.

Error in ==> test am 18
CX(end+1,:) = temp(1);

Hier ist der code:

file = fopen('C:\Program Files (x86)\Notepad++\testFile.txt'); % open text file

tline = fgetl(file); % read line by line and remove new line characters

%declare empty arrays
CX = [];
CY = [];
CZ = [];

while ischar(tline) % true if tline is a character array
    temp = textscan(fid,'%*s%f%f%f','Delimiter',',<>'); % loads the values from all rows with the specified format into the variable data

    CX(end+1,:) = temp(1);
    CY(end+1,:) = temp(2);
    CZ(end+1,:) = temp(3);

    tline = fgetl(file);
end

fclose(file); % close the file

plot3(CX, CY, CZ) % plot the data and label the axises
xlabel('x')
ylabel('y')
zlabel('z') 
grid on
axis square
  • Wenn Sie brechen, kurz bevor Sie den Fehler und geben Sie temp(1) in die Befehlszeile ein, was für ein Typ ist ans? Ist es ein cell-array ist oder ein double array. Ich gehe davon aus, dass der CX ist ein double array?
InformationsquelleAutor Andre A | 2012-05-23
Schreibe einen Kommentar