A résolu


2倍してみよう - ここからスタート!
初めにこの問題を試してみよう。 入力としてxを与え、それを2倍して結果をyに代入せよ。 Examples: Input x = 2 Output y is 4 Input x = 17 Output y is 34 ...

plus d'un an il y a

A résolu


ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
MATLABでは,角括弧の中に要素を入れることで、ベクトルを作成できる。 x = [1 2 3 4] また次のようにも書ける(コンマはオプション)。 x = [1, 2, 3, 4] 問題:次のベクトルを出力する関数を作成せよ。...

plus d'un an il y a

A résolu


サイコロを作ろう
1から6までの独立かつランダムな数値を返すような関数を作成しましょう。 例: >> [x1,x2] = rollDice(); と入力すると x1 = 5 x2 = 2 のような解を返します。

plus d'un an il y a

A résolu


二つのベクトルの要素ごとの積の平均を計算しよう
二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。 例: 二つのベクトル [1 2 3] と [10 15 20] が与えられたとき、 それぞれの要素ごとの積の平均を取ると、 解は 33.3333 と...

plus d'un an il y a

A résolu


ベクトルのスケーリング
入力したベクトルの大きさを1にしてください。

plus d'un an il y a

A résolu


Bit to Gigabyte
1 bit = 1.25 × 10^-10 gigabytes | x is bit | y is gigabyte

plus d'un an il y a

A résolu


Make an identity matrix whose diagonal elements are 1:n
For a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5: ...

plus d'un an il y a

A résolu


Converting binary to decimals
Convert binary to decimals. Example: 010111 = 23. 110000 = 48.

plus d'un an il y a

A résolu


Are you in or are you out?
Given vertices specified by the vectors xv and yv, and a single point specified by the numbers X and Y, return "true" if the poi...

plus d'un an il y a

A résolu


surface areas of a cylinder
There are 3 inputs: option, radius and height. If option= '1', compute the lateral surface area of the cylinder, for option 2 ca...

plus d'un an il y a

A résolu


replace empty matrices with '[]'
for example a=1;a(:,1)=[]; returns a = Empty matrix: 1-by-0 use this as the input,and the output should be '[]...

plus d'un an il y a

A résolu


The Answer to Life, the Universe, and Everything
A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

plus d'un an il y a

A résolu


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] ...

plus d'un an il y a

A résolu


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

plus d'un an il y a

A résolu


Add a row of zeros on top of a matrix
Given a matrix, insert a row of zeros as the top row.

plus d'un an il y a

A résolu


UICBioE240 problem 1.1
Remove the middle row from a matrix, assuming # of rows is odd. So if A = [ 1 2 3; 4 5 6; 7 8 9] the...

plus d'un an il y a

A résolu


UICBioE240 2.8
Convert x number of hours into seconds.

plus d'un an il y a

A résolu


UICBioE240 2.1
This will be useful later in the course, in conjunction to clc and clear all, what is the command to close all figure windows th...

plus d'un an il y a

A résolu


UICBioE240 problem 1.18
exp(pi/5*i) and exp(pi/5i). Is there any difference in result? Write yes or no as a string.

plus d'un an il y a

A résolu


Given a Vector v1, create v2 which is the sum of each two adjacent elements in v1. {length(v2)=length(v1)-1}
if v1 is [1 2 3 4 5 6 7 8] then v2 should be [3 5 7 9 11 13 15]. if v1 is [1; 3; 5; 7] the...

plus d'un an il y a

A résolu


Independent direction vectors of a plane
Given the equation of a plan of the form ax+by+cz=d, return 2 independent direction vectors which could e.g. be used to determin...

plus d'un an il y a

A résolu


Basic Matlab Operation Bonanza
Given a horizontal array of numbers, perform the following operations, in order: transpose, flip matrix horizontally, flip matri...

plus d'un an il y a

A résolu


Just another sum (JAS)
*Task:* Write a function that takes a vector X and returns the alternating sum of X: X(1)-X(2)+X(3)-X(4)+... *Example...

plus d'un an il y a

A résolu


Back to basics 10 - Max Float
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

plus d'un an il y a

A résolu


How to calculate log?
There is a log that have base 5. How to calculate? log5(x)?

plus d'un an il y a

A résolu


Add 3 (x<=100) Or Subtract 100 and add 3(100<x)
Add 3 to every element. However, if the value is greater than 100, subtract 100 and add 3. eg. input x = [45 106; 67 1...

plus d'un an il y a

A résolu


Create tangent function out of cosine only
Please don't use tangent and sine functions

plus d'un an il y a

A résolu


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

plus d'un an il y a

A résolu


03 - Matrix Variables 5
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3e.png>>

plus d'un an il y a

A résolu


Calculate the derivative of a polynomial
Example: in = [ 1 1 1 ] out = [ 2 1 ]

plus d'un an il y a

Charger plus