求下列题目翻译 50

NumericalandComputerTools1-Homework7DuebeforeClassSubmityourscriptthroughCanvas.Combi... Numerical and Computer Tools 1 - Homework 7
Due before Class

Submit your script through Canvas. Combine the scripts into one script separated into sections using the %% separator. Do not forget to include comments.

1. Write a program using a loop to add all the elements of a vector. Do not use the MATLAB function sum().

2. Write a program using loops to add all the elements of a matrix producing a scalar. Do not use the MATLAB function sum().

3. Assume you have a vector containing positive and negative numbers. Separate the vector into four vectors posEven, negEven, posOdd and negOdd where posEven contains all the even positive numbers, negEven contains all the negative even numbers, posOdd contains all the positive odd numbers and negOdd contains all the negative odd numbers.

4. Write a program to convert a binary number to a base 10 number. For example, 101101 would produce 45. Display the result as: The binary number xxxx is xxxx in base 10. Assume unsigned integers. Hint: input the binary number as a text string.

5. The USF math department has forgotten the value of pi and they want you to calculate it for them. Assume you have a quarter circle inside a square with sides of 1x1 unit. Then the radius of the circle is 1. The area of a circle is r2. If r = 1, the area is  and the area of a quarter circle is /4. Use a for loop beginning at 1 and ending at a number input from the keyboard to add random points in the square (use the MATLAB function rand() to get the
展开
 我来答
儒雅的1aws
2018-04-11
知道答主
回答量:31
采纳率:46%
帮助的人:9.4万
展开全部
数字和计算机工具1 -作业7 由于课前 通过画布提交脚本。将脚本合并成一个脚本,使用%分隔符分隔成部分。不要忘记包含注释。 1。用循环编写程序来添加向量的所有元素。不要使用MATLAB函数sum()。 2。编写一个程序,使用循环来添加生成标量的矩阵的所有元素。不要使用MATLAB函数sum()。 三.假设有一个包含正、负数的向量。将向量四向量poseven,negeven,posodd和negodd哪里poseven包含所有即使是正数,negeven包含所有负偶数,posodd包含所有的正奇数和negodd包含所有负奇数。 4。编写一个程序,将二进制数转换为基数为10的数字。例如,101101会产生45。显示结果为:二进制数XXXX在基础10中为XXXX。假设无符号整数。提示:输入二进制数作为文本字符串。 5。USF的数学系已经忘记了圆周率的计算,他们希望你为他们。假设你有一个四分之一圆内方与1x1单位面。然后圆的半径是1。一个圆的面积R2。如果r = 1,面积和1/4圆的面积是/ 4。使用一个循环从1开始和结束在一个从键盘的平方加随机点数字输入(使用MATLAB函数rand()得到
要解体成分子的人
2018-04-11 · TA获得超过9.7万个赞
知道顶级答主
回答量:8.8万
采纳率:96%
帮助的人:4137万
展开全部
Numerical and Computer Tools 1 - Homework 7
Due before Class

Submit your script through Canvas. Combine the scripts into one script separated into sections using the %% separator. Do not forget to include comments.

1. Write a program using a loop to add all the elements of a vector. Do not use the MATLAB function sum().

2. Write a program using loops to add all the elements of a matrix producing a scalar. Do not use the MATLAB function sum().

3. Assume you have a vector containing positive and negative numbers. Separate the vector into four vectors posEven, negEven, posOdd and negOdd where posEven contains all the even positive numbers, negEven contains all the negative even numbers, posOdd contains all the positive odd numbers and negOdd contains all the negative odd numbers.

4. Write a program to convert a binary number to a base 10 number. For example, 101101 would produce 45. Display the result as: The binary number xxxx is xxxx in base 10. Assume unsigned integers. Hint: input the binary number as a text string.

5. The USF math department has forgotten the value of pi and they want you to calculate it for them. Assume you have a quarter circle inside a square with sides of 1x1 unit. Then the radius of the circle is 1. The area of a circle is r2. If r = 1, the area is  and the area of a quarter circle is /4. Use a for loop beginning at 1 and ending at a number input from the keyboard to add random points in the square (use the MATLAB function rand() to get the
数字和计算机工具1 - 作业7
上课前到期
通过画布提交您的脚本。将脚本组合成一个脚本,使用%%分隔符将它们分隔为多个部分。不要忘记包含评论。
1.使用循环编写程序以添加矢量的所有元素。不要使用MATLAB函数sum()。
2.使用循环编写程序来添加产生标量的矩阵的所有元素。不要使用MATLAB函数sum()。
假设你有一个包含正数和负数的向量。将矢量分成posEven,negEven,posOdd和negOdd四个矢量,其中posEven包含所有偶数正数,negEven包含所有负偶数,posOdd包含所有正奇数,negOdd包含所有负奇数。
4.编写一个程序将二进制数转换为基数为10的数字。例如,101101将生成45.显示结果为:二进制数xxxx以基数10为单位。假设无符号整数。提示:输入二进制数字作为文本字符串。
5. USF数学系已经忘记了pi的价值,他们希望你为他们计算它。假设在一个正方形中有一个四分之一圆,边长为1x1单位。那么圆的半径是1.圆的面积是r2。如果r = 1,面积是,四分之一圆的面积是/ 4。使用for循环从1开始,结束于从键盘输入的数字,以便在方块中添加随机点(使用MATLAB函数rand()获取
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式