Best practices
Best Practices for Importing External Data
When working with external datasets in Twin Fabrica, these best practices will help you avoid common issues and ensure smooth data integration. Here are key recommendations for importing and managing data through the External Data panel.
1. Use Supported Data Types
Twin Fabrica imports data from external sources via .mat
files. Note that not all MATLAB-supported variable types are compatible with Twin Fabrica.
✅ Supported formats:
- Numerical arrays (e.g., vectors or matrices)
- Numerical tables (with consistent structure)
❌ Unsupported formats:
- Complex structures, cell arrays, or non-numeric data types
Before importing, make sure your .mat
file contains only supported data types to avoid import errors.
2. Use Unique and Clear Variable Names
Twin Fabrica requires each variable name to be unique. If a variable name matches one already in the project workspace, you'll see a "Variable overwriting" warning and the import will be blocked.
To prevent this:
- Review the variable names in your
.mat
file before importing. - Consider renaming variables in the file or workspace to avoid duplication.
- Alternatively, remove any previously loaded variables with conflicting names.
3. Maintain a Consistent Naming Convention
A clear and consistent naming convention for imported variables improves organization and reduces confusion, especially in complex projects with multiple datasets or team collaboration.
Recommended practices:
- Use descriptive, lowercase names (e.g.,
sensor_data
,test_input_01
) - Avoid special characters and spaces
- Include versioning or source identifiers when needed (e.g.,
temp_sensor_v2
)
4. Validate File Contents Before Importing
When previewing a .mat
file in the External Data window, check that:
- All variables listed are relevant and needed
- Variable types are supported
- Variable names are clear and non-redundant
Taking time to validate now can prevent issues during modeling, calibration, or simulation later.