Here is a way.
\documentclass{article}
\usepackage{tikz}
\makeatletter
\newcommand\store[6][\x]{%
% #1 = dummy variable
% #2 = variable to store the list
% #3 = expression
% #4 = expression to store (with \pgfmathresult) and possibly #1
% #5 = start point
% #6 = end point
\gdef\store@temp{\@gobble}%
\foreach #1 in {#5,...,#6}{\pgfmathparse{#3}\xdef\store@temp{\store@temp,#4}}%
\let#2=\store@temp
}
\makeatother
\begin{document}
\store{\sineslist}{sin(deg(\x))}{\pgfmathresult}{1}{100}
\show\sineslist
\store[\i]{\randlist}{rand}{(\i,\pgfmathresult)}{1}{20}
\show\randlist
\end{document}
Here's what's reported:
> \sineslist=macro:
->0.84143,0.90924,0.14111,-0.75677,-0.95886,-0.27939,0.65697,0.9893,0.41208,-0.
544,-0.99995,-0.53654,0.42015,0.99057,0.65025,-0.28787,-0.96138,-0.75095,0.1498
6,0.91292,0.83662,-0.00885,-0.84619,-0.90555,-0.13234,0.76251,0.95636,0.27087,-
0.6636,-0.988,-0.40402,0.55139,0.99988,0.52907,-0.42815,-0.99173,-0.64352,0.296
34,0.96375,0.74509,-0.1586,-0.91647,-0.83174,0.01768,0.85086,0.90175,0.12357,-0
.7682,-0.9537,-0.26234,0.67021,0.98657,0.3959,-0.55878,-0.99971,-0.52153,0.4361
4,0.99284,0.6367,-0.30478,-0.9661,-0.73914,0.16733,0.92,0.8268,-0.02654,-0.8554
7,-0.8979,-0.11476,0.77385,0.95105,0.2538,-0.67673,-0.98512,-0.38777,0.56606,0.
99948,0.51398,-0.44408,-0.99385,-0.62988,0.3132,0.9683,0.73317,-0.17606,-0.9234
,-0.82178,0.03539,0.86002,0.89395,0.10597,-0.77942,-0.94824,-0.24522,0.68324,0.
98354,0.3796,-0.57335,-0.99916,-0.50635.
> \randlist=macro:
->(1,-0.86513),(2,-0.8214),(3,0.83136),(4,0.03825),(5,0.0602),(6,0.65846),(7,-0
.7918),(8,0.8938),(9,-0.13474),(10,-0.90755),(11,0.68077),(12,-0.1404),(13,-0.4
3602),(14,-0.08235),(15,0.65369),(16,-0.25284),(17,0.98817),(18,-0.09077),(19,0
.42735),(20,0.88712).
Best Answer
Using the data you provided, here is a simple way to plot the surface:
It yields this output
Remark 1 This is a very simple code and it is possible to much more complex things using the pgfplots (cf this webpage).
Remark 2 If your matrix is big, you may want to process it first to get the coordinates in a file rather than entering them manually. For this many options are available using different softwares.
EDIT Another method for the same output (and for big matrices), the idea is adapted from this answer:
NOTE The
data.txt
file is the followingAnd its output: