How to solve the Data Type Mismatch error in Active cell balancing
15 views (last 30 days)
Show older comments
MAHENDRAN A
on 2 Jan 2023
Commented: Fatma GÜZEL
on 17 Apr 2023
I've developed an Active cell balancing model. The model and scripting file as no error, but while running the simulation, im getting data type error like this
An error ocurred while propagating data type 'Double'. I even attached the model. Can anyone say solution to my data type mismatch error.
0 Comments
Accepted Answer
Anthony Coadou
on 3 Jan 2023
Hello,
The problem is the size mismatch on port PWM. The block reads:
if SOC2<SOC1
s1=PWM;
s2=0;
elseif SOC1<SOC2
s1=0;
s2=PWM;
where s1 and s2 are alternatively assigned values of size 1 (scalar 0) and 2 (vector PWM). The MATLAB Function block tries to infer its output data types first, but fails to do so because of the type mismatch, and throws this cryptic error.
Hope that helps.
Anthony
3 Comments
Fatma GÜZEL
on 17 Apr 2023
Hi sir,
Were you able to make any progress on the last subject you wanted to do?
I'm working on the same issue, I'd be glad if you could help.
There is no problem in controlling with PWM, but I still get a double error when I try to control it with PID.
More Answers (0)
See Also
Categories
Find more on Naming Conventions 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!