No BSD License  

Highlights from
num2clip: copy numerical arrays to clipboard

4.2

4.2 | 5 ratings Rate this file 31 Downloads (last 30 days) File Size: 1.67 KB File ID: #8472

num2clip: copy numerical arrays to clipboard

by Grigor Browning

 

12 Sep 2005 (Updated 14 Sep 2005)

Copies a numerical array to the clipboard as a tab-separated string ready for pasting.

Editor's Notes:

This file was a File Exchange Pick of the Week

| Watch this File

File Information
Description

A basic extension to the existing MATLAB function clipboard.m. This function allows a numerical array of any size to be copied to the clipboard ready for pasting (to say Word or Excel).

The array is copied as a tab-separated string with carriage-returns separating subsequent rows.

I suspect someone may have created this already but I can't find anything on the exchange. Sorry if I am duplicating code.

Acknowledgements
This submission has inspired the following:
MAT2CLIP, Straightforward COPY and PASTE functions
MATLAB release MATLAB 7.0.4 (R14SP2)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
15 Sep 2005 James J. Cai  
22 Sep 2005 Gerd Kunert

The idea is nice.
However, Excel has very strange ways to open files and to import data (depending e.g. on your language).
In other words, the pasted data may be formatted in an "arbitrary" way. In my case, values were simply not correct.

Conclusion: Use xlswrite to export data to Excel. Otherwise fine.

29 Jan 2006 Gabriele Bulian

I had to change the line:
arraystring = num2str(array');
into
arraystring = num2str(array,'%100e');
otherwise I had some problems in making excel recognise the data...

12 Dec 2006 Mink H

Nothing wrong, it just works!!
I pasted directly into excel with no problems.
Keep it up!

23 May 2008 Jon Petter Grandal

Working excellent! This saves me a lot of work. Thanks!

Please login to add a comment or rating.
Updates
14 Sep 2005

Keyword update.

Tag Activity for this File
Tag Applied By Date/Time
data import Grigor Browning 22 Oct 2008 07:59:51
data export Grigor Browning 22 Oct 2008 07:59:51
copy Grigor Browning 22 Oct 2008 07:59:51
paste Grigor Browning 22 Oct 2008 07:59:51
clipboard Grigor Browning 22 Oct 2008 07:59:51
utilities Grigor Browning 22 Oct 2008 07:59:51
import Grigor Browning 22 Oct 2008 07:59:51
data Grigor Browning 22 Oct 2008 07:59:51
export Grigor Browning 22 Oct 2008 07:59:51

Contact us at files@mathworks.com