Clear Filters
Clear Filters

How to insert NaN at the end of matrix (.mat)

3 views (last 30 days)
I have a matrix (.mat) with two columns and I want to insert a line of NaN at the end of matrix...

Accepted Answer

John Chilleri
John Chilleri on 2 Feb 2017
Edited: John Chilleri on 2 Feb 2017
Would it be sufficient to:
Matrix_Name = [Matrix_Name; NaN NaN];
% Get rid of extra workspace variables so they're not also saved:
clearvars -except Matrix_Name
Hope this helps!

Sign in to comment.

More Answers (0)


Find more on Get Started with MATLAB 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!