Table won't show up when I publish
조회 수: 3 (최근 30일)
이전 댓글 표시
I have created a function and a separate script to run the function with my data, and format it into a table. When i click run in the script, it shows up in the command window as the pefect table that I need but then for some reason when i go to publish it, the table doesnt show up in my published pdf. What am I doing wrong ??? Attached are photos of my function, script, desired table, and what it shows when i publish
The Function is:
function bodymassindex=bmi(weight,height)
h=height./39.37;
w=weight./2.2046;
BMI=w./h.^2;
bodymassindex(BMI<=18.5)="underweight";
bodymassindex(BMI>18.5 & BMI<=25)="normal";
bodymassindex(BMI>25 & BMI<=30)="overweight";
bodymassindex(BMI>30)="obese";
end
The Script is:
W=80+170*rand(1,20);
H=50+35*rand(1,20);
result=bmi(W,H);
table=[num2str(W'),num2str(H'),result'];
array2table(table,"VariableNames",{'Weight in Pounds','Height in Inches','You Are'})
and my published script is displaying:

.
댓글 수: 1
답변 (1개)
Sai Sri Pathuri
2020년 2월 26일
I didn’t face any issue while running the script and publishing it. However, the following steps might help you.
Update the function and file system path caches using below command
rehash toolboxcache
Make sure that the script and bmi function are in the same folder before running the code and publishing.
You may refer following link for rehash function
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Model and Validate Requirements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!