Solved

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

8 years ago

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. Examples: fin...

8 years ago

Solved

Pizza!

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

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

8 years ago

Solved

Triangle Numbers

Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

8 years ago

Solved

Column Removal

Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

8 years ago

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

8 years ago

Solved

Weighted average

Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

8 years ago

Solved

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

8 years ago

Answered

How to arrange names in alphabetical order

You can use the SORT command: <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sort.html> An example: names ...

How to arrange names in alphabetical order

You can use the SORT command: <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sort.html> An example: names ...

8 years ago | 0

Answered

Design Iterative PID Tuner using MATLAB and Simulink

There is not a single solution, so let me list some ideas on how to approach your problem: - It seems that you look for the q...

Design Iterative PID Tuner using MATLAB and Simulink

There is not a single solution, so let me list some ideas on how to approach your problem: - It seems that you look for the q...

8 years ago | 0

Answered

Using a for loop to change matrix dimesnsions

I can suggest you an approach without FOR loops that's more synthetic and is not suffering of the changing size issue: %% Tes...

Using a for loop to change matrix dimesnsions

I can suggest you an approach without FOR loops that's more synthetic and is not suffering of the changing size issue: %% Tes...

8 years ago | 0

Answered

How to find row number

The command MAX will do the work. The second output is exactly the index of the max value. <http://www.mathworks.com/access/hel...

How to find row number

The command MAX will do the work. The second output is exactly the index of the max value. <http://www.mathworks.com/access/hel...

8 years ago | 0

Answered

program to get the user to enter the values

If you are expecting a command line input you can use the INPUT command: <http://www.mathworks.com/access/helpdesk/help/techd...

program to get the user to enter the values

If you are expecting a command line input you can use the INPUT command: <http://www.mathworks.com/access/helpdesk/help/techd...

9 years ago | 0

| accepted

Answered

Building PID without transfer functions

You can also create your PID (discrete) block on your own based on the difference equations. y(k) = yp(k) + yi(k) + yd(k) ...

Building PID without transfer functions

You can also create your PID (discrete) block on your own based on the difference equations. y(k) = yp(k) + yi(k) + yd(k) ...

9 years ago | 1

Answered

Basic Function Error (Plot Related

You should use the element by element power elevation ".^". Without the "dot" you are trying to do the power of a matrix and thi...

Basic Function Error (Plot Related

You should use the element by element power elevation ".^". Without the "dot" you are trying to do the power of a matrix and thi...

9 years ago | 1

| accepted

Answered

How to generate a vector with the required values

The syntax: x=[.1:.1:.9] is creating a vector incrementally and due to Floating Point arithmetic approximation the obtai...

How to generate a vector with the required values

The syntax: x=[.1:.1:.9] is creating a vector incrementally and due to Floating Point arithmetic approximation the obtai...

9 years ago | 2

| accepted

Answered

Variable into block "from workplace"

From Workspace block should have a first column representing time and then your data columns. This should work fine: data ...

Variable into block "from workplace"

From Workspace block should have a first column representing time and then your data columns. This should work fine: data ...

9 years ago | 1

| accepted

Answered

Problem with origin and plotting axes

Your code is basically: plot([1 1]'); and is represented by a line with first point(1,1) and second point (2,1) (giving ...

Problem with origin and plotting axes

Your code is basically: plot([1 1]'); and is represented by a line with first point(1,1) and second point (2,1) (giving ...

9 years ago | 0

Answered

Can MATLAB Fcn block output a bus?

The MATLAB function block is not able to create a bus. We strongly suggest the use of the Embedded MATLAB function that allo...

Can MATLAB Fcn block output a bus?

The MATLAB function block is not able to create a bus. We strongly suggest the use of the Embedded MATLAB function that allo...

9 years ago | 0

| accepted

Answered

problem with positioning in GUI

If you are working with normalized units you should use position values between 0 and 1 to set the position. The following co...

problem with positioning in GUI

If you are working with normalized units you should use position values between 0 and 1 to set the position. The following co...

9 years ago | 2

| accepted

Answered

Are there any functions for taking the most/least significant digits from a given value?

If I'm correctly understanding your question you would like to extract some digits from a number. The mathematical approach ...

Are there any functions for taking the most/least significant digits from a given value?

If I'm correctly understanding your question you would like to extract some digits from a number. The mathematical approach ...

9 years ago | 0

| accepted

Answered

is it possible to fit two curves (real and imaginary part) at the same time?

You need to separate the real and imaginary part and fit them individually. An example of this approach is available in the fol...

is it possible to fit two curves (real and imaginary part) at the same time?

You need to separate the real and imaginary part and fit them individually. An example of this approach is available in the fol...

9 years ago | 0

Answered

Create a vector x with the elements

You can use vector operations on the vector n with elements from 1 to 100: x = (-1.^n + 1/2*n -1); to create the x vecto...

Create a vector x with the elements

You can use vector operations on the vector n with elements from 1 to 100: x = (-1.^n + 1/2*n -1); to create the x vecto...

9 years ago | 2

Answered

Read each columns of xls,csv,... as a matrix

To read an Excel file you should use XLSREAD: <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/xlsread.html> The...

Read each columns of xls,csv,... as a matrix

To read an Excel file you should use XLSREAD: <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/xlsread.html> The...

9 years ago | 0

Answered

Storing multiple values in one location of matrix

If your need is to place the single digits to create a bigger number if you would like to avoid passing through string conversio...

Storing multiple values in one location of matrix

If your need is to place the single digits to create a bigger number if you would like to avoid passing through string conversio...

9 years ago | 1

Answered

How do I get pretty symbolic expressions in MATLAB using fancy?

The FANCY function on the MATLAB newsgroup is not part of standard MATLAB. To make use of that code you need to copy it from the...

How do I get pretty symbolic expressions in MATLAB using fancy?

The FANCY function on the MATLAB newsgroup is not part of standard MATLAB. To make use of that code you need to copy it from the...

9 years ago | 0