Answered
How to fill closed curves. The code I wrote can't be implemented, I don't know how to correct it, thanks for the answer.
fig = gcf; axObjs = fig.Children; dataObjs = axObjs.Children; xt= dataObjs(1).XData; yt= dataObjs(1).YData; fill(xt,yt,'r')...

4 years ago | 0

Answered
How to remove extra numbers to reduce size of vector?
A = rand(10000,1); s = 3; n = mod(length(A),s) ; iwant = A(1:end-n) ;

4 years ago | 2

| accepted

Answered
Error using inline/subsref (line 12) Not enough inputs to inline function.
These lines: f1a=f1(a);f1b=f1(b); f2a=f2(a);f2b=f2(b); Should be: f1a=f1(m,a);f1b=f1(m,b); f2a=f2(m,a);f2b=f2(m,b); As the...

4 years ago | 0

| accepted

Answered
plot vectors head to tail from dataset file
REad about quiver. May be you should check with: quiver(X1,Y1,X2-X1,Y2-Y1)

4 years ago | 0

Answered
READ DATA OF MULTIPLE CSV FILES
csvFiles = dir('*.csv') ; N = length(csvFiles) ; for i = 1:N T = readtable(csvFiles(i).name) ; % Do what you want ...

4 years ago | 1

| accepted

Answered
How to add string on x-axis and line starting from some point?
You can show up the string using text. Read about this function. You can draw line using plot.

4 years ago | 1

| accepted

Answered
Probing a plot based on colormap information
I don't think you would be able to see the values like that. But you can see what value it has using: F = scatteredInterpolant(...

4 years ago | 1

Answered
I need to filter this vector to pick out any numbers bigger than or equal to the threshold and put them into a new vector to be averaged
Let V be your vector and val be your threshold value. V(V>=val) =[] ; % remove the values greater than or equal to val iwan...

4 years ago | 0

Answered
Reshape matrix with multiple columns into 2 columns
A = [1 2 3 4;5 6 7 8;9 10 11 12] B = [1 2;5 6;9 10;3 4;7 8;11 12] iwant = [A(:,1:2) ; A(:,3:4)]

4 years ago | 0

| accepted

Answered
How to define a distance along a 2D nonlinear line generated by an equation, and find the corresponding distance along the x-axis?
Note the it is not a line but is a curve or a polynomial. You can achieve this by using the file exchange function interparc. ...

4 years ago | 1

| accepted

Answered
2D Vector plot from available numerical data ?
Read about he function quiver.

4 years ago | 0

Answered
How can I create a LOOP in order to take the magnitude from a 3D matrix at the same (x,y) coordinates but with different z?
Read about slice. Or if you have (X,Y) grid coordinates and the respective Z 3D data. USe knnsearch to get the index you want. C...

4 years ago | 0

Answered
How to group elements of an array?
REad about reshape. A = rand(1,4096); B = reshape(A,[],32) ;

4 years ago | 0

| accepted

Answered
How to use "Date Picker" to read a specific row and a column from a csv file that are associated with the date that was selected?
You can load the csv file data into MATLAB workspace using readtable. And then you can use ismember to get the index of the re...

4 years ago | 0

| accepted

Answered
how calculate monthly mean from 6 hourly timestep?
REad about retime. https://in.mathworks.com/help/matlab/ref/timetable.retime.html

4 years ago | 0

Answered
I HAVE A VECTOR AND I NEED TO INSERT 2 ZEROS BETWEEN EACH ELEMENT FROM THE ORIGINAL VECTOR.
v = [ 1 2 3 4 5] ; n = length(v) ; iwant = zeros(1,2*n-1) ; iwant(1:2:end) = v

4 years ago | 0

Answered
Help regarding plotting points in graph
p = 0:99 ; x = 10.^p ; semilogy(x)

4 years ago | 0

Answered
Matlab is not plotting
As you are plotting a point, you need to use marker. for i=1:10 M=1+i; plot(i,M,'.','MarkerSize',5) hold on en...

4 years ago | 0

| accepted

Answered
select a region of an image.
Read about imcrop. Let I be your image. I = imread(myimage) ; x = 50 ; y = 70 ; w = 120 ; h = 100 ; Rect = [x y w h] ...

4 years ago | 1

| accepted

Answered
How to compare elements of a 2D array with other elements of the same array.
You can use ismember. Read about the function ismember.

4 years ago | 0

Answered
Measuring distance between centroid and perimeter points
If C is your centroid coordinates and P is your m*2 array of points. Where m is the number of points. Then you can get the dista...

4 years ago | 0

Answered
how to plot country borders in regional data
You may download your required countries boundary shape file from this link: https://gadm.org/download_country.html You can re...

4 years ago | 0

Answered
I keep receiving an error saying "execution of script drawpolygon as a function is not supported", even though it has previously worked.
It looks like you have named the present code as drawpolygon. No you should not name it on that name as drawpolygon is a inbuilt...

4 years ago | 0

| accepted

Answered
For loops in strings
wavFiles = dir('*.wav') ; N = length(wavFiles) ; data = cell(N,1) ; fs = cell(N,1) ; for i=1:N [data{i},fs{i}]=audio...

4 years ago | 0

| accepted

Answered
Specific interval of imported data
import1 = allahus_2017till2021(24:48,:);

4 years ago | 1

Answered
Mapping non-integer values of matrix to another matrix via mapping table
v=[0.5 1.3 0.7 3 0.7 1.3]; m=[0.5 4; 0.7 5; 1.3 6; 3 7] ; w=[4 6 5 7 5 6]; [c,ia] = ismember(v,m(:,1)) ; iwant = m(ia,2)

4 years ago | 0

| accepted

Answered
How to generate next random number which is +-30% of previous random number
a = 66 ; % present random number % generate next random number +-30 of a % choose the sign randomly if rand > 0.5 ...

4 years ago | 0

Answered
assigning answers of logical operators to a vector using a for-loop
function y = testLucky(x) % testLucky(x) - determines whether input(x) is a lucky number % return true (1) if x is a lucky n...

4 years ago | 0

Answered
polyfit with cell array with non-uniform dimensions
Let Current_mA, voltage_V be your cell arrays. They are of equal dimensions. N = length(approxPoly) ; for i = 1:N appro...

4 years ago | 1

| accepted

Answered
How to use anonymous functions
The function needs a localCoordinate as input and it should be a 1X2 array. The array can have values 0,1,2. Depedning on the ...

4 years ago | 0

| accepted

Load more