Skip to content

Commit 3aa230b

Browse files
authored
Merge pull request #28 from flexcompute/filipe/to_mat_file
export sim data in MATLAB format
2 parents 7ad6ffe + 93015a9 commit 3aa230b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
_schema: default
3+
title: "How do I export Simulation data output to MATLAB format?"
4+
date: 2025-02-05 13:47:06
5+
enabled: true
6+
category: Data Visualization and Postprocessing
7+
_inputs:
8+
title:
9+
type: text
10+
label: QUESTION TITLE
11+
enabled:
12+
type: switch
13+
hidden: true
14+
date:
15+
type: datetime
16+
label: DATE
17+
instance_value: NOW
18+
category:
19+
type: select
20+
options:
21+
values: data.faq_categories
22+
value_key: key
23+
preview:
24+
text:
25+
- key: category_name
26+
---
27+
You can use the [SimulationData.to_mat_file]( https://docs.flexcompute.com/projects/tidy3d/en/stable/api/_autosummary/tidy3d.components.data.sim_data.SimulationData.html#tidy3d.components.data.sim_data.SimulationData.to_mat_file){: target="_blank" rel="noopener"} function to export simulation data in MATLAB format. For example:
28+
29+
<div><div markdown class="code-snippet">{% highlight python %}
30+
31+
# Run the simulation and get the data.
32+
sim_data = tidy3d.web.run(simulation, task_name="task", path="data/data.hdf5", verbose=True)
33+
34+
# Export to MATLAB format.
35+
sim_data.to_mat_file('/path/to/file/data.mat')
36+
37+
{% endhighlight %}
38+
{% include copy-button.html %}</div><p>You can find detailed information about simulation data visualization and postprocessing in this <a href="https://www.flexcompute.com/tidy3d/examples/notebooks/VizData/">tutorial</a>.</p></div>

0 commit comments

Comments
 (0)