A répondu

image axes modification/ pixel extension

You could use repelem to do this. Say that you have a matrix with 5 rows and 8 columns: Idx = reshape(1:5*8,5,8) And we want t...

image axes modification/ pixel extension

You could use repelem to do this. Say that you have a matrix with 5 rows and 8 columns: Idx = reshape(1:5*8,5,8) And we want t...

plus d'un an il y a | 0

A répondu

How to color the region between the cyan, black and blue curves

@Atom, i believe this is related to my previous answer, if the patch method was not suitable you can augment the question there ...

How to color the region between the cyan, black and blue curves

@Atom, i believe this is related to my previous answer, if the patch method was not suitable you can augment the question there ...

plus d'un an il y a | 0

| A accepté

A répondu

connect nodes (coordinates of a matrix rx3) with a line

i guess this is related to Sorting of points (2D) clockwise with respect to the center of gravity - MATLAB Answers - MATLAB Cent...

connect nodes (coordinates of a matrix rx3) with a line

i guess this is related to Sorting of points (2D) clockwise with respect to the center of gravity - MATLAB Answers - MATLAB Cent...

plus d'un an il y a | 1

A répondu

Sorting of points (2D) clockwise with respect to the center of gravity

Edit: modified the code after the OP added data... The sort trick with the angle won't work due to the shape of the curve. Belo...

Sorting of points (2D) clockwise with respect to the center of gravity

Edit: modified the code after the OP added data... The sort trick with the angle won't work due to the shape of the curve. Belo...

plus d'un an il y a | 0

| A accepté

A répondu

fsolve with writting automatically equations

Please try to avoid asking the same problems in many different questions. This makes it difficult for other people to track ting...

fsolve with writting automatically equations

Please try to avoid asking the same problems in many different questions. This makes it difficult for other people to track ting...

plus d'un an il y a | 0

| A accepté

A répondu

remove brace indexing from 1x1 matrix

I would recommand to read the text file into a string array, this will ease the conversion into function. See below for a demons...

remove brace indexing from 1x1 matrix

I would recommand to read the text file into a string array, this will ease the conversion into function. See below for a demons...

plus d'un an il y a | 0

| A accepté

A répondu

sprintf loop for writing equations

There is no need for the sprintf function, you can store the equations direclty into an string array. See below for an example. ...

sprintf loop for writing equations

There is no need for the sprintf function, you can store the equations direclty into an string array. See below for an example. ...

plus d'un an il y a | 1

| A accepté

A répondu

Customize Colormap with unequal range of colors.

% first create some plot data, we use the matlab peaks as example [X,Y,Z] = peaks(100); % rescale the Z values so that they ...

Customize Colormap with unequal range of colors.

% first create some plot data, we use the matlab peaks as example [X,Y,Z] = peaks(100); % rescale the Z values so that they ...

plus d'un an il y a | 0

A répondu

Find area of a polygon portion of an Image (Code generatable code)

For such a shape, you could determine the area via a set of triangles. Insert a new temporary point in the center of the shape. ...

Find area of a polygon portion of an Image (Code generatable code)

For such a shape, you could determine the area via a set of triangles. Insert a new temporary point in the center of the shape. ...

plus d'un an il y a | 0

A répondu

Comparison between 3D maps

Hello, you could use the scatter function to plot a sphere for the values that are true. Note, you need to use the ind2sub funct...

Comparison between 3D maps

Hello, you could use the scatter function to plot a sphere for the values that are true. Note, you need to use the ind2sub funct...

plus d'un an il y a | 1

| A accepté

A répondu

Arc travel of a line in 3D space.

Hi, if I understand you correclty you want to verify the distance between two positions of the point and prefferbaly have it con...

Arc travel of a line in 3D space.

Hi, if I understand you correclty you want to verify the distance between two positions of the point and prefferbaly have it con...

plus d'un an il y a | 0

| A accepté

A répondu

Sum specific dimension in matrix

Hello, in the demo code below you can find some comments and a procedure on how to get the indexes, extract the data and sum ove...

Sum specific dimension in matrix

Hello, in the demo code below you can find some comments and a procedure on how to get the indexes, extract the data and sum ove...

plus d'un an il y a | 0

| A accepté

A répondu

How to shift a fitted curve such that it would coincide on some point

Hi @Salma fathi, you can evaluate the fitted curve using the feval function. Below I provided a demonstration on how you could s...

How to shift a fitted curve such that it would coincide on some point

Hi @Salma fathi, you can evaluate the fitted curve using the feval function. Below I provided a demonstration on how you could s...

plus d'un an il y a | 0

A répondu

How to separately color regions R1, R2, R3, R4 in the 1st quadrant of (delta,theta) plane

Hi, below i demonstrated how to fill in the region using the patch command. % evaluate the function to set up the grid points ...

How to separately color regions R1, R2, R3, R4 in the 1st quadrant of (delta,theta) plane

Hi, below i demonstrated how to fill in the region using the patch command. % evaluate the function to set up the grid points ...

plus d'un an il y a | 0

A répondu

I need to run a surface diagram for variables using any 2 parameters. The following is the code for 2D plots. Please help me to run surf plot in MATLAB.

Hi see below for some comments in the code on how to set the dimmensions to call the surf command. options = odeset('RelTol',1e...

I need to run a surface diagram for variables using any 2 parameters. The following is the code for 2D plots. Please help me to run surf plot in MATLAB.

Hi see below for some comments in the code on how to set the dimmensions to call the surf command. options = odeset('RelTol',1e...

plus d'un an il y a | 1

| A accepté

A répondu

rotate the coordinates plotted with plot3 without changing the axes

Hi, in the code below I added some comments to demonstrate how you can rotate the curve. imageArray = imread("fig_A.png"); bin...

rotate the coordinates plotted with plot3 without changing the axes

Hi, in the code below I added some comments to demonstrate how you can rotate the curve. imageArray = imread("fig_A.png"); bin...

plus d'un an il y a | 0

| A accepté

A répondu

How can we move an object from A to B and then return it to the same psition which is A ?

I tried to made a commented example, hope it helps % initial poistion at x = -50 m and y = 50 m oldPosition = [-50; 50]; % ...

How can we move an object from A to B and then return it to the same psition which is A ?

I tried to made a commented example, hope it helps % initial poistion at x = -50 m and y = 50 m oldPosition = [-50; 50]; % ...

plus d'un an il y a | 0

| A accepté

A répondu

How to sort a part of a given array?

Hi, below you can find some example code to demonstrate how to sort the first 'nSort' elements of a given vector. % create a ve...

How to sort a part of a given array?

Hi, below you can find some example code to demonstrate how to sort the first 'nSort' elements of a given vector. % create a ve...

plus d'un an il y a | 0

A répondu

Using 'for loop' to plot

It's not really clear why you would like to use a loop since the vectorized method is a lot cleaner from a code perspective. How...

Using 'for loop' to plot

It's not really clear why you would like to use a loop since the vectorized method is a lot cleaner from a code perspective. How...

plus d'un an il y a | 0

| A accepté

A répondu

How to create a scatter plot with multiple data

Hello, see below for a demonstation on how to make the scatter plot. Note that it uses a 'crude' way to define the dates, proba...

How to create a scatter plot with multiple data

Hello, see below for a demonstation on how to make the scatter plot. Note that it uses a 'crude' way to define the dates, proba...

plus d'un an il y a | 0

A résolu

Vector creation

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

plus d'un an il y a

A résolu

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

plus d'un an il y a

A résolu

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

plus d'un an il y a

A résolu

Whether the input is vector?

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

plus d'un an il y a

A résolu

Get the length of a given vector

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

plus d'un an il y a

A résolu

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

plus d'un an il y a