I have a homework question I need assistance with. It has to do with surface area and parameters.
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am attempting to answer a homework problem that I have. The question asks, the surface area of a sphere is given by A = 4(pi)r^2. I am supposed to write a function that takes the radius as a parameter and returns the surface area of the sphere. The function is also supposed to work if a vector of a radius values are given. I have no clue where to start and a nudge in the right direction or an answer would be extremely helpful thanks!
0 commentaires
Réponses (1)
mohammad m
le 14 Déc 2016
Modifié(e) : mohammad m
le 14 Déc 2016
function A=Area(r)
A=4*pi*r.^2;
end
write your vector like this in command:
r=[r1 r2 r3 ...]
and in command by Area(r) calculate areas.
0 commentaires
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!