Answered

Rewrite for loop with find function

The function find returns the indeces according to the condition. So, in order to diplay the values, you might use the following...

Rewrite for loop with find function

The function find returns the indeces according to the condition. So, in order to diplay the values, you might use the following...

6 months ago | 1

Solved

How to find the position of an element in a vector without using the find function

Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for.

6 months ago

Solved

Determine if input is a perfect number

A <http://en.wikipedia.org/wiki/Perfect_number/ perfect number> occurs whent the sum of all divisors of a positive integer, exce...

6 months ago

Solved

Is it an Armstrong number?

An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. Fo...

6 months ago

Solved

First N Perfect Squares

*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

6 months ago

Solved

Project Euler: Problem 1, Multiples of 3 and 5

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

6 months ago

Solved

Cell joiner

You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

6 months ago

Solved

Vector creation

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

6 months ago

Solved

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 ...

6 months ago

Solved

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 ...

6 months ago

Solved

Whether the input is vector?

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

6 months ago

Solved

Get the length of a given vector

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

6 months ago

Solved

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...

6 months ago

Solved

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 ...

6 months ago

Answered

Accessing data variables from another function

I did not get the final goal, but I fixed your code. F2([1,1,1 ; 2 2 2 ; 3 3 3]) function [Q,R] = F1(A) Q = 2*A R ...

Accessing data variables from another function

I did not get the final goal, but I fixed your code. F2([1,1,1 ; 2 2 2 ; 3 3 3]) function [Q,R] = F1(A) Q = 2*A R ...

6 months ago | 1

| accepted

Answered

I need a code to count how many raw in my matrix above zero?

You might use the function find (https://www.mathworks.com/help/matlab/ref/find.html). Check the following code: B = [1,-1; 2,...

I need a code to count how many raw in my matrix above zero?

You might use the function find (https://www.mathworks.com/help/matlab/ref/find.html). Check the following code: B = [1,-1; 2,...

6 months ago | 0

Answered

Index exceeds the number of array elements (2)

Hi Ali, Your dsolve function has 4 states variables: dx(1,1), dx(2,1), dx(3,1), and dx(4,1). Therefore you need an initial vari...

Index exceeds the number of array elements (2)

Hi Ali, Your dsolve function has 4 states variables: dx(1,1), dx(2,1), dx(3,1), and dx(4,1). Therefore you need an initial vari...

6 months ago | 1

Answered

How to define limit of quiver axis?

You could use axis function. For more information check here: https://www.mathworks.com/help/matlab/ref/axis.html See the follo...

How to define limit of quiver axis?

You could use axis function. For more information check here: https://www.mathworks.com/help/matlab/ref/axis.html See the follo...

6 months ago | 2

| accepted

Solved

Multiply 2 numbers

Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...

7 months ago

Solved

Angle between Two Vectors

The dot product relationship, a dot b = | a | | b | cos(theta), can be used to determine the acute angle between vector a and ve...

7 months ago

Solved

Is the Point in a Circle?

Check whether a point or multiple points is/are in a circle centered at point (x0, y0) with radius r. Points = [x, y]; c...

7 months ago

Solved

Calculate the area of a triangle between three points

Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

7 months ago

Solved

Angle between two vectors

You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

7 months ago

Solved

Right and wrong

Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

7 months ago

Answered

Using 3x3 matrix to create 21x21 matrix

It is not clear the overlap values. I assumed the following: k33+k11 k33+k12 K33+k13 K33+k23 ..., Until the last is k33+k3...

Using 3x3 matrix to create 21x21 matrix

It is not clear the overlap values. I assumed the following: k33+k11 k33+k12 K33+k13 K33+k23 ..., Until the last is k33+k3...

7 months ago | 1

| accepted

Answered

Apply equation to an array of values producing a new data set

You do not need a door loop. Matlab is built to handle this kind of operation. Check the following: T = 1:1:122736; FcnT...

Apply equation to an array of values producing a new data set

You do not need a door loop. Matlab is built to handle this kind of operation. Check the following: T = 1:1:122736; FcnT...

7 months ago | 1