Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:42:24+00:00 2026-06-04T13:42:24+00:00

Can someone tell me why I am receiving this error — ??? The following

  • 0

Can someone tell me why I am receiving this error —
??? The following error occurred converting from cell to
double:
Error using ==> double
Conversion to double from cell is not possible.

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

Here is the 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:42:25+00:00Added an answer on June 4, 2026 at 1:42 pm

    Use cell2mat to convert from a cell array (what textscan returns) to a numeric array, which you can use (like append to, in your case) with other numeric arrays.

    I would also recommend using vertcat rather than the approach you’ve taken to concatenating:

    CX = vertcat(CX, cell2mat(temp(1)));
    

    Or, you could read all 3 values in to a row and concatentate into a N-by-3 matrix instead… lots of options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone tell me why this http://hupcapstudios.com/projects/calendar.html won't load in IE? The error message:
Can someone tell me how to accomplish this mapping using Fluent NHibernate? It's simply
Can someone tell me why this works: SELECT name FROM user WHERE uid IN
Can someone tell me why this code produces error? The C# code DateTime now
Can someone tell me why this processes all the files and then does it
Can someone tell me whether MSMQ (using transactions) supports competing consumers? Basically, I have
Can someone tell me why the following does not match: >>> re.search(r'(\d{2, 10})', '153')
Can someone tell me why this is not working: <button class=btn danger id=delete onclick=return
Can someone tell me what's wrong with this http://jsfiddle.net/Yp8Bz/ ? It works fine in
Can someone tell me why this is not working right? I have these lines

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.