MediaWiki to MATLAB Converter
Transform MediaWiki tables into MATLAB data structures including matrices, cell arrays, tables, and structs
MediaWiki Input
MATLAB Output
Convert other formats to MATLAB
Related Tools
MediaWiki to MediaWiki
Format and clean MediaWiki table markup with customizable styling options
MediaWiki to Pandas DataFrame
Convert MediaWiki table markup to Python Pandas DataFrame code
MediaWiki to PDF
Convert MediaWiki table markup to PDF document with formatting
MediaWiki to PHP
Convert MediaWiki table markup to PHP arrays and objects
MediaWiki to PNG
Convert MediaWiki table markup to PNG image with customizable styling
MediaWiki to Protocol Buffers
Convert MediaWiki table markup to Protocol Buffers schema and data
About MediaWiki to MATLAB Converter
Convert MediaWiki table markup to MATLAB data structures including numeric matrices, cell arrays, tables, and struct arrays. Perfect for importing wiki data into MATLAB for analysis, visualization, and computation.
Key Features
- Multiple Formats: Cell array, numeric matrix, MATLAB table, and struct array
- Automatic Type Detection: Identifies numeric vs. string data
- Header Support: Includes headers in appropriate formats
- String Escaping: Properly escapes single quotes in strings
- Valid Identifiers: Generates valid MATLAB variable and field names
- MediaWiki Parser: Accurately parses MediaWiki table syntax
- File Upload: Upload .wiki files directly
- Copy & Download: Easy export to .m files
How to Use
- Input MediaWiki Table: Paste your MediaWiki table markup or upload a .wiki file
- Configure Options: Choose output format and header preferences
- Review Output: The MATLAB code generates automatically
- Copy to MATLAB: Use the Copy button and paste into MATLAB editor
- Run in MATLAB: Execute the code to create the data structure
Output Format Options
- Cell Array: Universal format supporting mixed data types (strings and numbers)
- Numeric Matrix: For purely numeric data, creates a standard MATLAB matrix
- MATLAB Table: Modern table format with named columns (requires R2013b or later)
- Struct Array: Array of structures with named fields
Example Conversion
MediaWiki Input:
{| class="wikitable" border="1"
! Name !! Age !! Salary
|-
| John Doe || 28 || 75000
|-
| Jane Smith || 34 || 85000
|} MATLAB Output (Cell Array):
% Cell array with data
data = {
'Name', 'Age', 'Salary'
'John Doe', 28, 75000
'Jane Smith', 34, 85000
}; MATLAB Output (Table):
% MATLAB table (requires R2013b or later)
data = table({'John Doe'; 'Jane Smith'}, [28; 34], [75000; 85000], ...
'VariableNames', {'Name', 'Age', 'Salary'}); Common Use Cases
- Data Analysis: Import wiki datasets for statistical analysis
- Scientific Computing: Load experimental data from wikis
- Visualization: Create plots and charts from wiki tables
- Machine Learning: Prepare training data from wiki sources
- Simulation: Use wiki parameters in MATLAB simulations
- Research: Import published data tables for reproduction studies
Cell Array Format
Most versatile format supporting mixed data types:
- Handles both strings and numbers
- Works with all MATLAB versions
- Easy to access with indexing:
data{row, col} - Can include headers as first row
Numeric Matrix Format
Efficient format for purely numeric data:
- Standard MATLAB matrix (2D array)
- Fast computation and memory efficient
- Access with indexing:
data(row, col) - Automatically falls back to cell array if non-numeric data detected
MATLAB Table Format
Modern format with named columns (R2013b+):
- Column names from headers
- Access by name:
data.ColumnName - Supports mixed data types per column
- Integrates with MATLAB's table functions
- Best for data analysis and statistics
Struct Array Format
Array of structures with named fields:
- Field names from headers
- Access with dot notation:
data(idx).fieldname - Natural representation for records
- Works well with object-oriented code
Working with Generated Code
After pasting into MATLAB:
% Run the generated code
% Access data (cell array example)
name = data{2, 1}; % Get first name
age = data{2, 2}; % Get first age
% Access data (table example)
names = data.Name; % Get all names
avgAge = mean(data.Age); % Calculate average age
% Access data (struct example)
firstName = data(1).Name;
totalSalary = sum([data.Salary]); Data Type Detection
The converter automatically detects data types:
- Numeric: Values that can be parsed as numbers (integers or decimals)
- String: Text values enclosed in single quotes
- Mixed: Columns with both types use cell arrays
Variable Name Generation
For tables and structs, headers are converted to valid MATLAB identifiers:
- Spaces and special characters replaced with underscores
- Must start with a letter (adds 'Var_' prefix if needed)
- Examples: "First Name" → "First_Name", "2nd Value" → "Var_2nd_Value"
Tips for Best Results
- Use headers for table and struct formats
- Ensure numeric data doesn't contain text for matrix format
- Keep header names simple for easier variable access
- Test the code in MATLAB after generation
- Use appropriate format for your use case (table for analysis, matrix for computation)
MATLAB Version Compatibility
- Cell Array: All MATLAB versions
- Numeric Matrix: All MATLAB versions
- Table: MATLAB R2013b and later
- Struct Array: All MATLAB versions
MediaWiki Table Syntax
Supports standard MediaWiki table markup:
- {|: Table opening with optional attributes
- ! Header: Exclamation mark for header cells (separated by !!)
- |-: Row separator
- | Data: Pipe for data cells (separated by ||)
- |}: Table closing
FAQ
What types of MediaWiki tables are supported?
This tool supports standard MediaWiki table markup that starts with {| and ends with |}, using ! for headers, |- for row separators, and |/|| for data cells.
How does the tool decide whether a value is numeric or string?
The converter checks each cell to see if it can be parsed as a number. Pure numeric values are treated as numbers in MATLAB, while anything else (including mixed text and numbers) is treated as a string and wrapped in quotes.
When should I use cell arrays vs. tables vs. structs?
Use cell arrays when you have mixed data types and need maximum compatibility, tables when you want named columns and advanced analysis (R2013b+), and struct arrays when you prefer record-like access with dot notation (for example, data(1).Name).
What happens if some rows have missing cells?
Rows with missing cells are still included. Empty cells become empty strings in string contexts or are handled as non-numeric values when attempting numeric formats, which may cause the converter to fall back to a cell array.
Is any of my table data uploaded to a server?
No. All parsing and conversion happen locally in your browser. Your MediaWiki table content is never sent to any server, ensuring your data remains private.
Privacy & Security
All conversions happen locally in your browser. Your MediaWiki data is never uploaded to any server, ensuring complete privacy and security.
