Answered
Performing computation using contents stored in a table
Version without tables var11 = [1 2 3 4 5 6 7 8 9]'; var12 = [2 3 4 5 6 7 8 9 10]'; value = [1 2 1 2 1 2 1 2 1]'; i = 2; in...

6 years ago | 0

Answered
Avoid nans in 2D cubic spline interpolation
Here is what i tried: Created new mesh and place there NaN (red points_ clc,clear % generate random data x = sort(ran...

6 years ago | 0

Answered
How to add a trendline to a histogram plot and not show the histogram?
Here is my solution x = randi(100,1,100); hist(x,20); [y,x0] = hist(x,20); hold on plot(x0,y) hold off

6 years ago | 0

Answered
How to plot from a line array?
Here is an example clc,clear % create some data with handles h(1) = plot([0 1],[0 1],'r'); hold on h(2) = plot([1 3],...

6 years ago | 1

Answered
Contour plot: how to plot matrix Z as the y-axis and array Y as the levels
I have generated a matrix Z of data, by looping arrays X and Y in nested for-loops Use meshgrid to create X and Y as matrices ...

6 years ago | 0

| accepted

Answered
Pore size distribution chart
Use regionprops I = imread('image.jpeg'); I1 = im2bw(I); % binarize image cc = bwconncomp(I1); ...

6 years ago | 0

| accepted

Answered
How to visualize al the values inside the array and make split them into two sections?
Just use logical indexing ix = val > 2; scatter3(x(ix),y(ix),z(ix),10,'r') hold on scatter3(x(~ix),y(~ix),z(~ix),10,'r') ho...

6 years ago | 0

| accepted

Answered
Plot all four functions
Please use hold on

6 years ago | 0

Answered
How to attempt the first stage of this task?
I give you a start: This is cosine wave (one cycle) I usually use linspace to form array with number of points i want x = l...

6 years ago | 0

| accepted

Answered
How to plot a single column of values with a linear regression line through it
Here is a simple example (i made it special for you) N = 20; x = linspace(0,3,N); y = 2*x + rand(1,N); p = polyfit(x,y,1); ...

6 years ago | 0

| accepted

Answered
Fill area between contour levels
Here is an idea: plot all your contours fill external contour you want [~,h1] = contourf(X,Y,Z,[1 1],'edgecolor','none');...

6 years ago | 1

Answered
analytic solution with infinite sum
Here is my attempt Ti = 150; T1 = 300; T2 = 200; L = 1; alpha = 0.1; delta_x = 0.05; delta_t = 0.01; N_time = 51; N_spa...

6 years ago | 0

Answered
Two curves in one plot with wrong scaling
Use function that fit() returns [fitresult, gof] = fit( xData, yData, ft, opts ); % plot(fitresult,'r') plot(xData,fitresult(...

6 years ago | 0

| accepted

Answered
My Excel writing program does not stop
It this a success? V1 = randi(100,5,5); for i = 1:size(V1,1) vv1 = { num2str(V1(i,:)) }; xlswrite('data.xls',vv1,'sh...

6 years ago | 0

| accepted

Answered
Hi All,Remove empty [] entries row in Timetable, rmmissing is not removing rows which have empty entries, Please help, thank you very much
I found a way. FInally! A = readtable('data.txt','delimiter','\t',... 'ReadVariableNames',false); % wit...

6 years ago | 0

| accepted

Answered
How to differentiate a series of functions denoted by varying a parameter i=1,2 in (h_i)?
Mistake that h_1 and h_i and different variables m1stake = 2; m2stake = 3; for i = 1:2 disp(mistake) % doesn't...

6 years ago | 1

| accepted

Answered
Solving FitzHugh-Nagumo equations using ODE45
Here is my achievement. I don't get about stim. Can you explain more? % du/dt = c1u ( u − a)(1 − u) − c2uv +stim ...

6 years ago | 0

| accepted

Answered
Convert a vector to single element
Use cells signal = cell(254,1); for i = 1:255-1 signal{i} = dec2bin(i,8); end

6 years ago | 0

Answered
Plotting an array of vectors
Try following h = get(gca); % h = get(gca,'children'); % or try this y = get(h(1),'ydata'); set(h(1),'ydata',y+50)

6 years ago | 0

Answered
How could I code for loop with this values?
This script should give you success you are looking for A = [40, 60, 30, 80, 70, 50, 90, 30]; B = A(1); for i = 2:length(A) ...

6 years ago | 2

| accepted

Answered
How to keep column of removed row in matrix
It was harder that i thought clc,clear % create some data A = zeros(10); ix = randi(100,1,10); % random ...

6 years ago | 0

| accepted

Answered
Changing equation with loop
Use this Me = sqrt(2./(gamma-1).*((nPratio.^((gamma-1)./gamma))-1)); ind = Me < 1; x = (P0.*sqrt(gamma/R).*Me.*(1+((gamma-1)/...

6 years ago | 0

Answered
Need help finding the cartesian coordinates of a projectile in flight.
Here is what i invented clc,clear x1 = 671.4971; y1 = 717.2387; z1 = 0; az1 = 75.1148*pi/180; el1 = 9.3679*pi/180; [u1,...

6 years ago | 0

Answered
Cubic smooth spline plot in 3d for several layers
Maybe you don't need interpolation. I just removed NaN numbers D = importdata('Data.txt'); A = D.data; x = A(:,1); cla ho...

6 years ago | 0

Answered
Interpolate Points of a 3D Point Cloud?
Use griddata to create surface Use contour3 to create crossection clc,clear load data.txt x = data(:,1); y = data(:,2); z ...

6 years ago | 1

| accepted

Answered
Why is my scatter plot producing inconsistent results?
I made some changes to your code. Look points = [pd17 ev17 mat17 cai17 mar17 jen17 bla17 sch17 jam17 nad17 pd18 ev18 c...

6 years ago | 0

| accepted

Answered
How to show only elliptic region in color?
try this [X,Y] = meshgrid( -10:0.2:10 ); Z = X.^2 + Y.^2; ind = X.^2/5^2 + Y.^2/3^2 < 1; Z(~ind) = nan; pcolor(X,Y,Z)

6 years ago | 0

| accepted

Answered
How to shade area under 2D- curve into a certain x values
Maybe something is wrong with importing? Try importdata Data = importdata('cl024_12._lab.txt'); L = Data.data(:,5); Depth = D...

6 years ago | 0

| accepted

Answered
How to plot the 3D spherical histogram?
You can create it manually clc,clear v = rand(10,3)*2-1; v0 = v(:,1)*0; quiver3(v0,v0,v0,v(:,1),v(:,2),v(:,3),1) axis equ...

6 years ago | 0

Answered
Intersection of two helical surfaces
Try filexchange surface_intersection

6 years ago | 0

Load more