Help me with the MATLAB Code

1 回表示 (過去 30 日間)
Mohamad Alrifai
Mohamad Alrifai 2021 年 3 月 3 日
回答済み: Rashed Mohammed 2021 年 3 月 8 日
Generate an array of 100 numbers containing randomly generated integers between 10 and 30. For this: (make sure you include your code part of your submission)
  • Use the while loop to calculate the sum of the square of the numbers, and save the answer to variable “sum_square”
  • Use a for loop to calculate the sum of the square of the even numbers, and save the answer to variable “sum_even”
  • Use a for loop to calculate the sum of the square of the odd numbers, and save the answer to variable “sum_odd”
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 3 日
Homework Question: Here

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

回答 (1 件)

Rashed Mohammed
Rashed Mohammed 2021 年 3 月 8 日
Hi Mohamad Alrifai
Since this seems like a homework assignment, if you can provide the code you've written to solve the problem and ask a specific question about where you're facing difficulty, we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, As suggested by Kalyan, you can start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
Hope this helps.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by