필터 지우기
필터 지우기

GeneratePa​rameterDat​aForDatash​eetBattery​BlockExamp​le

조회 수: 5 (최근 30일)
Craig Hoff
Craig Hoff 2020년 12월 11일
답변: Uday Pradhan 2020년 12월 14일
I'm trying to understand the GenerateParameterDataForDatasheetBatteryBlockExample example. https://www.mathworks.com/help/autoblks/ug/generate-parameter-data-for-datasheet-battery-block.html
I'm stumped on the syntax of: ref_curr = current == current(ref_exp);
What is that statement doing?
And I'm stumped by how the script runs. If I run the entire script, it runs fine. If I try to run the section that contains that line, it generates an error. How is that possible?
Thanks

답변 (1개)

Uday Pradhan
Uday Pradhan 2020년 12월 14일
Hi Craig,
I assume that you are trying to run the script "GenerateParameterDataForDatasheetBatteryBlockExample.m" by using the command:
openExample('autoblks/GenerateParameterDataForDatasheetBatteryBlockExample');
Now in this example: "current" is a 1 by 11 vector and ref_exp is 2, so the line:
ref_curr = current == current(ref_exp);
simply means that ref_curr is a 1 by 11 logical vector defined as:
ref_curr(idx) is 1 if and only if current(idx) is equal to the value current(ref_exp)
else, ref_curr(idx) is 0, where 1 <= idx <= 11.
Now, for the second part of your question: I did not encounter any errors while running the sections progressively. Could you share the error you encountered?

카테고리

Help CenterFile Exchange에서 Automotive Applications에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by