フィルターのクリア

How can I write this function so I can use it on multiple values?

1 回表示 (過去 30 日間)
S
S 2014 年 10 月 4 日
編集済み: Mischa Kim 2014 年 10 月 4 日
I have written a function for finding the body mass index based on weight and height. However, I can only calculate this for one person at a time. If I am given three weights and corresponding heights, how can I calculate these all at once?
Here is the scalar code I have so far:
function [ bmi ] = calculatebmi( h,w )
%UNTITLED9 Summary of this function goes here
% Detailed explanation goes here
bmi=(w*4.88)/h.^2
end

採用された回答

Mischa Kim
Mischa Kim 2014 年 10 月 4 日
編集済み: Mischa Kim 2014 年 10 月 4 日
Use
bmi = (w*4.88)./h.^2
instead. Note the dot in front of the forward slash.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by