Getting data from an equation using mathematica

  • Context: Mathematica 
  • Thread starter Thread starter Lamanova
  • Start date Start date
  • Tags Tags
    Data Mathematica
Click For Summary
SUMMARY

To extract data from an equation using Mathematica for plotting in MATLAB, define your function and create a data table over the desired variable range. For example, using the function F[x_, y_] = Sin[x 5] Sin[y 5], generate data with the command data = Table[F[x, y], {x, 0, 1, 0.1}, {y, 0, 1, 0.1}]. Export the generated data to a MATLAB-compatible format using Export["c://data.MAT", data], allowing for seamless integration into MATLAB for visualization with the imagesc command.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of data structures in Mathematica
  • Basic knowledge of MATLAB commands, specifically imagesc
  • Experience with exporting and importing data between software
NEXT STEPS
  • Learn advanced data manipulation techniques in Mathematica
  • Explore MATLAB's data visualization capabilities beyond imagesc
  • Study the Export function in Mathematica for different file formats
  • Investigate optimization of function performance in Mathematica
USEFUL FOR

Mathematicians, data scientists, and engineers who require data extraction and visualization across Mathematica and MATLAB platforms.

Lamanova
Messages
1
Reaction score
0
how can I get data from a certain equation using Mathematica in order to plot them using MATLAB command (imagesc) !
 
Physics news on Phys.org
Take your function and create a table over the range of variables you want.

IN MATHEMATICA
F[x_,y_] = Sin[x 5] Sin[y 5];
data = Table[F[x,y],{x,0,1,0.1},{y,0,1,0.1}];
ListPlot3D[data]

Then export that data

Export["c://data.MAT", data];

This is a Matlab matrix filetype that you can then import into matlab.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K