- Data Format and Preprocessing: Ensure that the input data from the power system (PMUs data) is correctly formatted and preprocessed to match the expected input format of your MATLAB function.
- Variable Naming and Scope: Check that variable names and scope are consistent between your MATLAB script and the MATLAB function. Variables used within the function should match those used in the script.
- Function Input Arguments: Confirm that the input arguments of your MATLAB function match the number and type of inputs required by your original script.
- Variable Initialization: Verify that all variables used within the function are properly initialized. MATLAB functions often require explicit variable initialization, while scripts may rely on the order of execution to set values.
- Input Data Verification: Check the input data from the power system for anomalies, missing values, or outliers that may cause unexpected behavior in your function.
getting wrong output when i am giving Variable input to math function
2 views (last 30 days)
Show older comments
When i am running Matlab mfile with single input i am getteng correct output values, but when i am converting that code into math function and giving variable inputs from pmus data in sim power system i am getteng wrong output values, can anyone suggest how to resolve it.
0 Comments
Answers (1)
Atharva
on 4 Sep 2023
Hey Venkateswararao,
When you have a MATLAB script (.m file) that works correctly with single input values but encounters issues when converted into a MATLAB function that takes input from power system data, there could be several reasons for the discrepancy in output values. Here are some steps you can take to troubleshoot and resolve the issue:
I hope it helps!
0 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!