フィルターのクリア

Hi, I try to solve below question but I have a problem, my answer is wrong

6 ビュー (過去 30 日間)
SULE SAHIN
SULE SAHIN 2017 年 10 月 27 日
コメント済み: Walter Roberson 2018 年 11 月 19 日
Write a function that is called like this: amag = accelerate(F1,F2,m). F1 and F2 are three-element column vectors that represent two forces applied to a single object. The argument m equals the mass of the object in units of kilograms. The three elements of each force equal the x, y, and z components of the force in Newtons. The output variable amag is a scalar that is equal to the magnitude of the object’s acceleration. The function calculates the object’s acceleration vector a by using Newton’s law: F = ma, where F is the sum of F1 and F2. Then it returns the magnitude of a. Hint: we are talking about physical vectors here, so the Pythagorean theorem will come in handy.
My answer is;
function amag = accelerate(F1,F2,m)
F = F1 + F2;
amag = F./m;
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 4 月 27 日
Please do not close questions that have an answer.

サインインしてコメントする。

採用された回答

Birdman
Birdman 2017 年 10 月 27 日
Change the line
amag = F./m;
to
amag=sqrt(sum(F.^2))/m;
  7 件のコメント
Akash Kumar
Akash Kumar 2018 年 10 月 16 日
I write it as F=sqrt(F.1.^2+F2.^2); amag=F./m and got wrong answer. Why?
Torsten
Torsten 2018 年 10 月 16 日
F1 instead of F.1

サインインしてコメントする。

その他の回答 (3 件)

Isaac DeVaughn
Isaac DeVaughn 2017 年 12 月 6 日
I think i understand the your answer basically there's an extra formula for the magnitude of F=squareroot(Fx^2+Fy^2+Fz^2) that is supposed to be implied by that last line. I didn't understand that from the question but thats kinda how magnitude works
  1 件のコメント
Vaibhav Sharma
Vaibhav Sharma 2018 年 1 月 28 日
i understand this one a little bit but not fully pls do explain

サインインしてコメントする。


Amit Kumar
Amit Kumar 2018 年 2 月 19 日
what is wrong with code? this code runs correctly for some values but showing error for F1=[1;0;0], F2=[0;1;0] and m=1 function [ amag ] = accelerate( F1,F2,m ) F=(sqrt(F1.^2)+sqrt(F2.^2)); amag=sum(F/m); end

Muniba Arshad
Muniba Arshad 2018 年 7 月 9 日
編集済み: Walter Roberson 2018 年 7 月 9 日
Guys this is the correct solution,
amag = accelerate(F1,F2,m)
F_sum = F1 + F2;
F = sqrt(F_sum(1,1)^2+F_sum(2,1)^2+F_sum(3,1)^2);
amag = F/m;
Explanation: First add the vectors then find the magnitude of resultant vector and apply the formula a=F/m on it.
  2 件のコメント
Naitikkumar Darji
Naitikkumar Darji 2018 年 11 月 19 日
can u explain how its work??
Walter Roberson
Walter Roberson 2018 年 11 月 19 日
? The line at the bottom already explains it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by