Answered
Why i am getting error in the 2nd input line
It looks there is some function in your working directory on the name input. What does which input show up? Rename the functi...

4 years ago | 0

Answered
I need to add color shapes to dose distribution images
Read about patch, area.

4 years ago | 0

Answered
How to compare lat lon from text file with netcdf file?
REad about interp2. You can do the interpolation and extract your required data. data2 = interp2(X1,Y1,data1,X2,Y2) ; % wher...

4 years ago | 0

Answered
Issue with plot when using 2 FOR loops
X = zeros([],1) ; Y = zeros([],1) ; Z = zeros([],1) ; count = 0 ; for k=1:3 for j=1:3 % the main code ...

4 years ago | 0

Answered
Creating empty cell array with function
It seems you are straight away running the function. You need to provide the inputs to the function and then call the function. ...

4 years ago | 0

Answered
How to Append all values in single array in MATLAB
iwant = [out1 out2 out3 out4];

4 years ago | 0

| accepted

Answered
How to solve a system of two equations of three variable?
If you have the points in hand already and you want to find the points of intersection, you can try this fileexchnage function: ...

4 years ago | 1

Answered
Exponential Function Plotting From Reverse
clear all close all t = 0:1:150; x = log(1004*t); figure plot(t,x,'Color','r') grid minor set(gca,'XDir','reverse')

4 years ago | 0

Answered
Plotting values by defining a function plotter
Your inputs to the function are not correct. The function: plotter( Interval,k,b ) Interval should be an array/ vector. Exam...

4 years ago | 0

| accepted

Answered
How Can I randomly select 10% of my array values and replace it with N/A or zero
Let A be your 250x1000 array. N = numel(A) ; % total number of elements idx = randsample(N,round(10/100*N)) ; % select 10% ...

4 years ago | 1

| accepted

Answered
Multiplying two vectors to form a matrix
x = rand(601,1) ; y = rand(601,1) ; iwant = sqrt(x.^2+y'.^2) ; size(iwant)

4 years ago | 1

Answered
What is the way to create and save files?
You have to use imwrite. Read about it.

4 years ago | 0

Answered
Find array row element in another index array
iwant = P(reshape(dx_of_pt',[],1),:) ;

4 years ago | 0

| accepted

Answered
Why points inside a polygon can't be found completely by using "Inpolygon"
load('data.mat') idx = boundary(xloc,yloc) ; % pick the boundary points which form a polygon ind=inpolygon(source_xtheta,sour...

4 years ago | 1

| accepted

Answered
There is an error where i have noted. anyone know how I could fix it?
Your A and b are going to be a 3D matrix. Check the below code. %% Model parameters m=1500; I=2500; lf=1.1; lr=1.6; l=lf+l...

4 years ago | 0

Answered
I am not able to fix the error(s) in this command script. Can anyone help me?
clear; close all; clc; xmin = 0; xmax = 1; n = 100; dx = (xmax - xmin)/n; dt = 0.001; C = 10; L = 10; r = C*dt/dx; c = ...

4 years ago | 0

| accepted

Answered
How can I sort intersections points given from polyxpoly according to order of appearence?
I would suggest to use this. https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections

4 years ago | 0

Answered
How to plot inset in a subplot defined by axesand position?
figure('position',[100 100 800 900]) % subplot('position',[100 100 800 300]) x=linspace(1,10); y=linspace(1,10); plot(x,y) ...

4 years ago | 0

Answered
How do I input multiple values in an array/matrix multiple times?
Save them into a cell. d = cell(cnt-1, 1); for i = 1:1:cnt-1 a = Value(IdxStart(i):IdxStart(i+1)-1); b = Time(IdxSta...

4 years ago | 0

| accepted

Answered
Why I am getting this error message?
It looks like r3 is not an integer, it has decimals. Try: r3 = round(r3) ; % round r3 to the nearest integer d3x3 = wind...

4 years ago | 0

| accepted

Answered
A(I): index out of bounds; value 6 out of bound 5. How to fix this error?
a = [2:2:10]; b = zeros(1,length(a)-1); for i = 1:length(a)-1 b(i) = a(i+1) - a(i); end Or Simply: b = diff(a)

4 years ago | 0

Answered
Find the extremum of the surface
Read this: https://in.mathworks.com/help/matlab/ref/surf.html To get the extremum, read this: https://in.mathworks.com/help/ma...

4 years ago | 0

Answered
Iterating through Matlab Table
LEt T be your table. With first column as dates. % First make the dates daily thedates = T.(1) ; % existing dates of the ta...

4 years ago | 0

| accepted

Answered
How can I remove the line for nan in my ploting
% remove that line idx = x>11.3 ; y3_km(idx) = NaN ; y4_km(idx) = NaN ;

4 years ago | 0

Answered
Finding intersection point of two vectors
You can use this file exchange function. https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections

4 years ago | 0

Answered
How can I select a cell containing a specific text from a nx1 cell array and store it in a variable?
Read about contains, strcmp, strcmpi, strfind. All these functions give you index where theres is a match with the given input s...

4 years ago | 0

| accepted

Answered
Trying to count number of occurrences that exceed a threshold over a certain amount of time.
if T is your temperature array. dT = diff(T) ; nnz(dT<5)

4 years ago | 0

| accepted

Answered
How to find an eigenvector
Read about the function eig. A = magic(5) ; [V,D] = eig(A) ; vec = V val = diag(D)

4 years ago | 0

| accepted

Answered
length(find((XM(2:end)>126.5 & XM(1:end-1)<126.5)| (XM(2:end)<126.5 & XM(1:end-1)>126.5)));
They represent second to last and first to last but one elements respectively. % Example a = rand(5,1) ; a [a(2:end) a(1:en...

4 years ago | 0

Answered
How do I get rid of certain values with the same X-axis value in a certain range?
Put a logical conditioning, get indices and remove those points. Simple. Example: y = rand(1,10) ; % random data for demo ...

4 years ago | 0

Load more