- #1

- 195

- 0

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- #1

- 195

- 0

Physics news on Phys.org

- #2

- 1,235

- 18

Try a loop within a loop to go through all x values then all y values?

Code:

```
z = zeros(1000);
for x= 1:1000
for y = 1:1000
z(x,y) = x + y;
end
end
```

- #3

- 166

- 0

Code:

```
[x y] = meshgrid(1:1000);
z = x + y;
```

- #4

- 22

- 0

Can anyone help how to write the matrix

A=[ 2 1 0 0 0

0 2 1 0 0

1 0 2 1 0

0 1 0 2 1

0 0 1 0 2]

I need A with the above pattern of any dimension n and also a vector of the form

v=[3 3 4 4 4 4 ...4 3 3]^T where v can be of any dimension. I'll be grateful for your help.

The purpose of evaluating functions in MATLAB with an x,y range of 1-1000 is to analyze the behavior of a function over a large range of input values. This can provide valuable insights and help in making decisions related to the function's use and optimization.

To specify the x,y range when evaluating a function in MATLAB, you can use the colon operator ":". For example, if you want to evaluate the function for x values from 1 to 1000, you can use the syntax "x = 1:1000". This will create a vector with values from 1 to 1000 that can be used as input for the function.

Yes, you can evaluate multiple functions at once with an x,y range of 1-1000 in MATLAB by using the element-wise operations. This allows you to perform operations on arrays of values, making it possible to evaluate multiple functions simultaneously.

To plot the results of evaluating a function in MATLAB with an x,y range of 1-1000, you can use the "plot" function. This will generate a line plot with the x values on the horizontal axis and the corresponding y values on the vertical axis. You can also customize the plot by adding labels, titles, and adjusting the axes.

Yes, it is possible to evaluate functions with non-numeric inputs in MATLAB. This can be done by using symbolic variables and functions, which allow you to work with algebraic expressions and perform operations on them. This can be useful for evaluating functions that involve symbols or variables instead of fixed numbers.

Share:

- Replies
- 4

- Views
- 143

- Replies
- 4

- Views
- 1K

- Replies
- 4

- Views
- 740

- Replies
- 5

- Views
- 586

- Replies
- 4

- Views
- 1K

- Replies
- 2

- Views
- 2K

MATLAB
How to plot data in MATLAB?

- Replies
- 2

- Views
- 1K

- Replies
- 1

- Views
- 5K

- Replies
- 2

- Views
- 934

MATLAB
C++ and Python vs MATLAB

- Replies
- 5

- Views
- 2K