Note that there are some explanatory texts on larger screens.

plurals
  1. POAvoid list being truncated by Matlab
    primarykey
    data
    text
    <p><strong>Edit 1 - This question has been solved and it was due to a typo thanks to Floris for spotting this.</strong></p> <p>I have a one line matrix in Matlab which it is truncating and causing me to loose data.</p> <p>My code reads:</p> <pre><code>[status,Vf_rpm_string] = system (fragment_velocity_string); Vf_rpm_shape=regexprep(Vf_rpm_string,'\n',' '); Vf_rpm_vector=str2num(Vf_rpm_string); Vf_rpm= reshape(Vf_rpm_vector,[],1); </code></pre> <p>The code conducts a system command and stores the result, the result is a Matrix of numbers and sometimes the last line in the matrix has less columns than the previous lines. Matlab doesn't like this, as it does not know what to do with the empty few columns in the last line. So I have to remove the new line character from the results <code>(\n)</code> and replace it with a space. </p> <p>This was working fine until the results from the system command were too large and so when I remove the new line character <code>(\n)</code> and replace it with a space creating a one line matrix it is too long for Matlab and it truncates it and I loose a lot of my data. So when I convert the returned data (which is returned as a string) to a number it gives me an empty matrix, then the reshape command is pointless at this point.</p> <p>This is how it reads in Matlab: </p> <pre><code> 20.65866342... Output truncated. Text exceeds maximum line length of 25,000 characters for Command Window display. </code></pre> <p>So the 20.65866342 is the last value before I start to loose data. I know it says it is too large for the command window but still the variable does not store all the data and it is lost.</p> <p>Does anyone have any solutions to avoid this truncation? Or does anyone want to suggest an alternative method for me to convert my data?</p> <p>I am using Matlab 2012b and Windows 7</p> <p>Thanks for your time.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload