Gelöst


Return area of square
Side of square=input=a Area=output=b

fast 5 Jahre vor

Gelöst


Add two numbers
Given a and b, return the sum a+b in c.

fast 5 Jahre vor

Gelöst


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

fast 5 Jahre vor

Gelöst


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

fast 5 Jahre vor

Gelöst


Create a vector
Create a vector from 0 to n by intervals of 2.

fast 5 Jahre vor

Gelöst


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

fast 5 Jahre vor

Gelöst


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

fast 5 Jahre vor

Gelöst


Find max
Find the maximum value of a given vector or matrix.

fast 5 Jahre vor

Gelöst


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

fast 5 Jahre vor

Gelöst


Inner product of two vectors
Find the inner product of two vectors.

fast 5 Jahre vor

Gelöst


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

fast 5 Jahre vor

Gelöst


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

fast 5 Jahre vor

Gelöst


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

fast 5 Jahre vor

Gelöst


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

fast 5 Jahre vor

Gelöst


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

fast 5 Jahre vor

Gelöst


Square
square root of x

fast 5 Jahre vor

Gelöst


factorial
calculate x!

fast 5 Jahre vor

Frage


Generate random numbers from a vector
I would like Matlab to give me a number from a given row vector, such as: A=[1 3 5 9 100 150 658 999]; Matlab would either giv...

fast 5 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


A question related to subs in ode (symbolic maths toolbox)
I have a line: ode=diff(y,x)==x+y; I want matlab to calculate diff(a,b), given a and b are real numerical values. However, the...

etwa 5 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


A problem related to symbolic function.
I know that if a want to check if a variable is a function handle, then I can use isa(fun,'function_handle'). What should I typ...

etwa 5 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


I am having problems in anonymous function (y=@(x)(...))
Let me re-word my querry. Let's say there is a square matrix of v=[1 2 3 4 5 6 78 9 10; 11 12 13 14 15 16 17 18 19 20;21 22 23 ...

etwa 5 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


I am struggling to use sprint
Hi, I have a problem regarding the use of sprintf. Inside a user-defined function (which I can edit), the output is "A" an...

etwa 5 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Convert number to string problem
I would like to ask if there is a way to output a number, which is stored as a variable, using simple commands, as shown in the ...

mehr als 5 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


An "if-loop" and "for-loop" problem
Please help. I am trying to make a nested for-loop with a if-loop inside as follows: S=0; for i=1:10 for j=(i+1)...

etwa 6 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Problem on code while plotting a graph
I am plotting a graph, with the line: figure; hold on ; ..... title('function'); ..... hold off; But I end...

etwa 6 Jahre vor | 1 Antwort | 0

1

Antwort