Answered
Make coastline contour from DEM (3d matrix)
[c,h] = contour(dem,[0.5 0.5]) ; % filter c idx = c(1,:)<1 ; c(:,idx) = NaN ; figure pcolor(dem) ; shading interp ;...

7 years ago | 0

| accepted

Answered
How to pull a range of values out of an array using a loop
Simply use: idx = tau < 1e8 ; In idx, 1 is acceptable and 0 is unacceptable. Read baout logical indexing. You need not run ...

7 years ago | 0

Answered
how to combine three different column into a single colum using colon
If you have it in matrix...A use.. iwant = A(:) ;

7 years ago | 0

Answered
Increase the resolution of line plots
Read about interp1, interp2, imresize.

7 years ago | 0

Answered
calculation x-value, given the y-value of a discrete function
Read about interp1, knnsearch.

7 years ago | 0

Answered
How can i query last column based on another values column
You can use inequalitites ==, >, <, >=, <=. Read about them. Read the excel data into MATLAB using xlsread or readtable. ...

7 years ago | 0

Answered
How to generate point cloud of two merged spheres?
Refer here: https://in.mathworks.com/help/matlab/math/numbers-placed-randomly-within-volume-of-sphere.html

7 years ago | 0

Answered
Index in position 2 exceeds array bounds
You size of pos is 4x2....you are trying to accessing third coulmn from pos....where as it has only two columns..so obviously yo...

7 years ago | 0

Answered
Is there a way to pass in a matrix of color values (n*3) into plot in matlab
You need not use a loop..you can make your data a matrix and use plot. X = repmat(1:10,10,1) ; Y = rand(10) ; plot(X',Y')

7 years ago | 0

Answered
Convert 2D data to 3D matrix
If T is your Table...you can access the data of the column using T.(1) , T.(2), T.(3) etc.,. If you have column names....you can...

7 years ago | 1

Answered
store multiple values in one variable
dataset_folder='D:\Project\resize\'; file_name=dir(fullfile(dataset_folder,'*.jpg')); total_images=numel(file_name); r = zero...

7 years ago | 0

| accepted

Answered
How to delete values when value is 3&4 then 7&8 then 11&12....
If you have an array A...To remove a specific element use: A(A==val) = [] ;

7 years ago | 1

Answered
getting error in calculation and plot. what is the exact problem
YOu have a function handles in plot..you need to send input to those functions handles. P=101.325; a1=7.19736;b1=1574.99;...

7 years ago | 0

Answered
How can eliminate features whose values are zero from array?
If A is your array..you can remove zeros using: A(A==0) = [] ; Or A = A(A~=0) ;

7 years ago | 0

| accepted

Answered
How to map two different gray pattern in two images?
You can make boundary as below: I = imread('temp1.jpg') ; [nx,ny,nz] = size(I) ; [X,Y] = meshgrid(1:ny,1:nx) ; id = I~...

7 years ago | 0

Answered
How to arrainge data to use streamline?
I guess what you have is unstructured FEM mesh data. YOu need to convert it to grided data. You can do inteprolation using gridd...

7 years ago | 0

Answered
Error using plot Conversion to double from sym is not possible.
YOu have po to be symbolic element. YOu need to substitute x and get the value in double and plot. clc; clear all; syms x ...

7 years ago | 0

Answered
Multidimensional for loop to store values/frame
You can reshape the matrix into 2D and use the respective functions. A = rand(2,2,5) ; A = reshape(A,[],5) ; Avg = mean(...

7 years ago | 0

Answered
Find edges in a plot
A very quck implementation.....canbe further refined and more elegant solution possible. p =[ 106 20; ...

7 years ago | 1

Answered
how to find division of two consecutive number of matrix without using for loop?
a= [1 2 3 4 5 6 7 8 9]'; iwant = a(1:end-1)./a(2:end)

7 years ago | 0

Answered
How can I convert douvle value to int or Integer?
Read about int32, int64, uint32, uint64.

7 years ago | 0

Answered
How can I create time in proper format to export to a netCDF (.nc) file in MATLAB?
Convert the dates into numbers using datenum. These numbers can be written into netCDF file. Read about datenum.

7 years ago | 0

Answered
How to use a for loop to iterate through all columns in a row, and then go down each row and iterate through all the corresponding columns in the same way?
V = Currents./r ; Where Currents is your 531*758 matrix and r is 531*1 matrix.

7 years ago | 0

Answered
matrix multiply by array xi=xj
e = [0 1 0 1;1 0 1 1;0 1 0 1;1 1 1 0]; x = [1 2 3 4] ; A = zeros(size(e)) ; for i = 1:4 for j = 1:4 A(i,j) = e(i,j)...

7 years ago | 0

| accepted

Answered
how to have the same plot area size when some axis names become 2 lines
Use like this: plot(rand(1,100)) title({'First line';'Second line'}) xlabel({'First line';'Second line'}) ylabel({'First l...

7 years ago | 0

Answered
how to generate 360 images by applying rotation from 1 to 360 degree on same points?
th= 0:1:360 ; R=@(theta) [cosd(theta) -sind(theta) 0; sind(theta) cosd(theta) 0; 0 0 1]; points = ...

7 years ago | 0

| accepted

Answered
how to solve Beam on elastic foundation equation
You can use symbolic calcultations. Like below: syms E I k w(x) eqn = E*I*diff(w,x,4)+k*w == 0 ; sol = dsolve(eqn) ; You ...

7 years ago | 0

Answered
Why is the contour plot flipped i.e. the value that should be at the bottom right is plotted on the top left?
YOu need not to use loops....it is very slow. Check the below code: Nx = 100 ; Ny = 100 ; x = linspace(0,1,Nx) ; y = lins...

7 years ago | 1

| accepted

Answered
Color map and shading interp not working with plot3
surf(x_new,T_disc,all_out); shading interp Shading interp works with pcolor/ surf.

7 years ago | 1

| accepted

Answered
Is there a way to compute the percentage of pixels in this image of a certain colour, whilst ignoring the (dark blue) background in the calculation?
If I is your image.....And your pixel value is n. Use: idx = I==n ; YOur idx will be a matrix with 1's and 0's...

7 years ago | 0

| accepted

Load more