What is the problem with the below code?

Why is MATLAB displaying an error for me with this code:
%Calculate the percenatge difference:
diff20 = (drugs20 - placebo20)./ placebo20 * 100;
diff30 = (drugs30 - placebo30)./ placebo301 * 100;
diff = (drugs - placebo)./ placebo * 100;

답변 (1개)

VBBV
VBBV 2023년 3월 14일

1 개 추천

diff30 = (drugs30 - placebo30)./ placebo30 * 100;

댓글 수: 3

VBBV
VBBV 2023년 3월 14일
The variables placebo301 doesn't exist. May be it's placebo30 instead
Roa
Roa 2023년 3월 14일
편집: Roa 2023년 3월 14일
Yeah sorry that was a typo i fixed it but still displays error
Rik
Rik 2023년 3월 14일
Try to make a MWE so we can run your code without any other dependencies and can reproduce your issue. The best way to do this is to use the code section in the editor and use the run button. That way you can make sure we will see the same error message as you do.
The information that Matlab "still displays error" is not enough to help you.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Parallel Computing에 대해 자세히 알아보기

태그

질문:

Roa
2023년 3월 14일

댓글:

Rik
2023년 3월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by