Answered

How to make a color sphere as colorbar in 3D image

[X,Y,Z] = sphere; surf(X,Y,Z) colorbar

How to make a color sphere as colorbar in 3D image

[X,Y,Z] = sphere; surf(X,Y,Z) colorbar

7 days ago | 0

Answered

I am trying to plot x and y with y being the only unknown but I don’t what is wrong in my code please help

Your x is an array Where as theta is only a scalar. You have to make theta and x both arrays of same size. You need to use...

I am trying to plot x and y with y being the only unknown but I don’t what is wrong in my code please help

Your x is an array Where as theta is only a scalar. You have to make theta and x both arrays of same size. You need to use...

7 days ago | 0

Answered

Open specific format file outside MATLAB ?

Right click on the C file...click on the "open with" and the choose "choose default program", after this selct your visula studi...

Open specific format file outside MATLAB ?

Right click on the C file...click on the "open with" and the choose "choose default program", after this selct your visula studi...

7 days ago | 0

Answered

Trim only edge NaN values

X = [NaN, NaN, 2, 5, 1, 6, NaN, 1, NaN, NaN]; A = isnan(X) ; idx = find(A & diff([0 A]) == 1 & diff([A 0]) == 0) ; idx = [...

Trim only edge NaN values

X = [NaN, NaN, 2, 5, 1, 6, NaN, 1, NaN, NaN]; A = isnan(X) ; idx = find(A & diff([0 A]) == 1 & diff([A 0]) == 0) ; idx = [...

7 days ago | 0

| accepted

Answered

Hello everyone, how to write the code to calculate the similarity coefficient of two curves?Another problem is that when fitting a curve, the interval of a curve x is [-3,3], and it will exceed this interval when fitting a curve. I don’t know where t

load jizuobiao1.mat RHO11 = XX1 ; THETA11 = linspace(-pi,+pi,length(RHO11))' ; f1= fit(THETA11,RHO11,'smoothingspline','Smo...

Hello everyone, how to write the code to calculate the similarity coefficient of two curves?Another problem is that when fitting a curve, the interval of a curve x is [-3,3], and it will exceed this interval when fitting a curve. I don’t know where t

load jizuobiao1.mat RHO11 = XX1 ; THETA11 = linspace(-pi,+pi,length(RHO11))' ; f1= fit(THETA11,RHO11,'smoothingspline','Smo...

7 days ago | 0

Answered

Abaqus input file edit as required by user

Refer this: https://in.mathworks.com/matlabcentral/answers/307258-extract-nodes-and-elements-from-abaqus-input-file-to-matlab ...

Abaqus input file edit as required by user

Refer this: https://in.mathworks.com/matlabcentral/answers/307258-extract-nodes-and-elements-from-abaqus-input-file-to-matlab ...

8 days ago | 0

Answered

Get all unique combinations from cell array for use as functional arguments

A 2*2 matrix means there are four elements i.e. four global indices. idx = 1:4 ; c = nchoosek(idx,2) C has the possible comb...

Get all unique combinations from cell array for use as functional arguments

A 2*2 matrix means there are four elements i.e. four global indices. idx = 1:4 ; c = nchoosek(idx,2) C has the possible comb...

10 days ago | 0

| accepted

Answered

Derivative without diff function

You should proceed something like this: fun = @(y,t) y/t; t = linspace(0,60,500) ; y = sin(t) ; df = zeros(length(t)-1) ...

Derivative without diff function

You should proceed something like this: fun = @(y,t) y/t; t = linspace(0,60,500) ; y = sin(t) ; df = zeros(length(t)-1) ...

10 days ago | 0

Answered

Hello everyone, how can I plot the following six curves on a graph? More importantly, compare the similarity of the six curves.

Read about hold on to plot all the curves in a single plot...you can give legend ti differentiate the each curve. To get similia...

Hello everyone, how can I plot the following six curves on a graph? More importantly, compare the similarity of the six curves.

Read about hold on to plot all the curves in a single plot...you can give legend ti differentiate the each curve. To get similia...

10 days ago | 0

Answered

chop array and average

data = [1 0 2 0 4 1 6 1 7 1 4 2 3 2 1 0 7 0 2 1 5 0 6 0 2 2] ; A = zeros(1...

chop array and average

data = [1 0 2 0 4 1 6 1 7 1 4 2 3 2 1 0 7 0 2 1 5 0 6 0 2 2] ; A = zeros(1...

10 days ago | 0

Answered

Hello everyone, I would like to ask how to keep only the fitted curve and delete the data points in the picture below. The program is shown below, I don't know how to modify it.

plot(f1)

Hello everyone, I would like to ask how to keep only the fitted curve and delete the data points in the picture below. The program is shown below, I don't know how to modify it.

plot(f1)

10 days ago | 1

| accepted

Answered

finding the smallest euclidean distance of one point (lon & lat) to two matrices one containing lon the other lat

REad about knnsearch. This will give you the required number of indices along with distances closest to the given point.

finding the smallest euclidean distance of one point (lon & lat) to two matrices one containing lon the other lat

REad about knnsearch. This will give you the required number of indices along with distances closest to the given point.

11 days ago | 0

Answered

How to plot contourf using following information?

pr is a 3D matrix, you cannot use contourf on a 3D matrix. You need to draw layer by layer. [m,n,p] = size(pr) ; for i = 1:p...

How to plot contourf using following information?

pr is a 3D matrix, you cannot use contourf on a 3D matrix. You need to draw layer by layer. [m,n,p] = size(pr) ; for i = 1:p...

11 days ago | 1

| accepted

Answered

how to duplicate rows in a 2D matrix

A = magic(4); A(2,:) = A(1,:)

how to duplicate rows in a 2D matrix

A = magic(4); A(2,:) = A(1,:)

11 days ago | 0

| accepted

Answered

Remove parenthesis and the contents inside from a string

A = 'abc (ABC)' ; idx = strfind(A,' (') ; iwant = A(1:idx-1)

Remove parenthesis and the contents inside from a string

A = 'abc (ABC)' ; idx = strfind(A,' (') ; iwant = A(1:idx-1)

11 days ago | 0

Answered

How to divide two datasets element wise ?

iwant = data_CP./data_PYP*1000 ;

How to divide two datasets element wise ?

iwant = data_CP./data_PYP*1000 ;

11 days ago | 0

| accepted

Answered

How to average columns of matrix without loop?

There are functions possible to do the said. Read about movemean, blockproc, reshape.

How to average columns of matrix without loop?

There are functions possible to do the said. Read about movemean, blockproc, reshape.

12 days ago | 1

Answered

How to create a lookup table?

Read about knnsearch. Also have a look on scatteredInterpolant.

How to create a lookup table?

Read about knnsearch. Also have a look on scatteredInterpolant.

12 days ago | 0

Answered

Get a new matrix from another matrix through loop

D_GW = zeros(2,3); D_GW(:,1) = 0; D_AQ = [2 3; 5 6]; % D_GW = [0 2 5; 0 5 11] for row = 1:size(D_AQ,1) ...

Get a new matrix from another matrix through loop

D_GW = zeros(2,3); D_GW(:,1) = 0; D_AQ = [2 3; 5 6]; % D_GW = [0 2 5; 0 5 11] for row = 1:size(D_AQ,1) ...

12 days ago | 0

| accepted

Answered

How can I find the number of row in which the maximum value obtained for a particular column?

Read about the function max. A = rand(10) ; % 10*10 matrix [val,idx] = max(A(:,3)) % maximum value for the oclumn 3 fp...

How can I find the number of row in which the maximum value obtained for a particular column?

Read about the function max. A = rand(10) ; % 10*10 matrix [val,idx] = max(A(:,3)) % maximum value for the oclumn 3 fp...

12 days ago | 0

| accepted

Answered

How can I extract multiple subsequences from a set of values?

Read about reshape. x=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]; m = length(x) ; n = 5 ; x = [x NaN(1,(n - r...

How can I extract multiple subsequences from a set of values?

Read about reshape. x=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]; m = length(x) ; n = 5 ; x = [x NaN(1,(n - r...

12 days ago | 1

| accepted

Answered

How to plot same function from different starting positions

C = 51 ; absorbed_solar_radiation = 239.4 ; A = 221.2 ; B = -1.3 ; greenhouse_effect_PI = 0 ; dt = 1 ; n_step = 200 ; ...

How to plot same function from different starting positions

C = 51 ; absorbed_solar_radiation = 239.4 ; A = 221.2 ; B = -1.3 ; greenhouse_effect_PI = 0 ; dt = 1 ; n_step = 200 ; ...

12 days ago | 0

| accepted

Answered

I have x y z points for the object, I have to increase the number of points to get better view of the object by interpolation

Read about griddata, scatteredInteprolant.

I have x y z points for the object, I have to increase the number of points to get better view of the object by interpolation

Read about griddata, scatteredInteprolant.

13 days ago | 0

Answered

scatter random points around polynom

x_poly = [700 750 730 630 700 745 830 765 700]; y_poly = [0 266 570 780 1150 1300 1580 1880 2400]; %Create Polynom based on u...

scatter random points around polynom

x_poly = [700 750 730 630 700 745 830 765 700]; y_poly = [0 266 570 780 1150 1300 1580 1880 2400]; %Create Polynom based on u...

13 days ago | 0

Answered

Creating and executing function

https://in.mathworks.com/learn/tutorials/matlab-onramp.html

Creating and executing function

https://in.mathworks.com/learn/tutorials/matlab-onramp.html

13 days ago | 2

Answered

Plot multiple b-value on an error vs frequency plot.

Something like this: clear all; close all; clc; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ...

Plot multiple b-value on an error vs frequency plot.

Something like this: clear all; close all; clc; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ...

13 days ago | 0

Answered

How to get every possible combinations of elements to approach a value and plot them together?

x = [144.2,31,138.8,56,54,27,25,24,18,17,12,4,266,240.5,215,132,75,30.3,20,19,18,18] ; n = 3 ; val = 325 ; y = nchoosek(x...

How to get every possible combinations of elements to approach a value and plot them together?

x = [144.2,31,138.8,56,54,27,25,24,18,17,12,4,266,240.5,215,132,75,30.3,20,19,18,18] ; n = 3 ; val = 325 ; y = nchoosek(x...

13 days ago | 0

Answered

Filter out NaNs but not lose data completely?

You can fill those NaN's using multiple ways. Read about fillmissing. You can also use interpolation methods to fill those nanas...

Filter out NaNs but not lose data completely?

You can fill those NaN's using multiple ways. Read about fillmissing. You can also use interpolation methods to fill those nanas...

13 days ago | 1

| accepted