How can I display text on pcolor map like in the image below?
L = membrane(1, 100); s=pcolor(L); s.EdgeColor='none'; set(gca, 'YDir', 'reverse') xl = xlim; yl = ylim; n = 1; xy =[]; ...

18 Tage ago | 0

| accepted

How to change the values of the corners in a matrix
a= zeros(10, 10); % smaller matrix for easy display % for corners a([1 end], [1 end]) = 1; a

18 Tage ago | 0

| accepted

Why does my code slow down around the 20th iteration?
The recursive function is the culprit of the speed. Simply replace them with mean and var. A_set = []; n=1; while 1==1 %eval...

18 Tage ago | 0

| accepted

Plotting with bisection method
Bisection method tries to find solution in a given interval. Generally, you don't know how many roots a non-linear equation has...

18 Tage ago | 0

| accepted

Name table columns with variable index

19 Tage ago | 0

| accepted

How to save results in a file without overwritting previous results????
Use append option when you save the data to files. [You can also use low-level fopen with option 'a+' for appending] % create ...

19 Tage ago | 0

Output argument's name same as input argument's
Functionally, they are same. However, some differences may exist: The obvious one is the program style (using input as output ...

19 Tage ago | 0

How to output a cell array using fprintf?
% cell array a = {'# To Select', 'Names', 'Barcodes', 'Prices'; 1, 'ABC', 1234, 4.5} fprintf("%s\n", formattedDisplayText(a))

20 Tage ago | 0

| accepted

showing empty plot in nexttile or subplot
a = "r"; b="g"; c="b"; d="m"; x{1}=[0.1 0.2 0.3 0.6 0.24 0.67]; y{1}=[2 1 4 7 4 5]; t{1}=[a b a c d b] x{2} = []; y{2} ...

20 Tage ago | 0

| accepted

Can writetable delimit strings using single-quotes?
You may not change the quote string with writetable directly. However, you can add a single quote to your string before writing...

20 Tage ago | 0

| accepted

When i run the code, i dont see any plot, and i'm not sure why?
syms x; increment = 0.0; m=0.5+increment; %Units are in SI Pr=0.718; %Prandtl number rho=1.204...

20 Tage ago | 0

automatically scale display range to eliminate outliers
y = randn(50, 50); y (20, 20) = 1e8; % outlier subplot(121) imagesc(y); % outlier removed colorbar subplot(122) imagesc...

20 Tage ago | 1

| accepted

Edit legend description and make a dot in on of the character
Try to modify the following: % generate some data data = (1:10)' + randi([3 20], [1 4]); plot(data) legend(["1 \$s=u\$" "2 \$s=...

20 Tage ago | 0

plotting nonlinear equation along real and imaginary axis
Try the following: Re-arrange the equation so that it is polynomial of complex variable z with coefficients being function of r...

20 Tage ago | 0

| accepted

sum of dirac delta function
syms x t y(x) = dirac(x-1); for i=4:3:200 y(x) = y(x) + dirac(x-i); end z = y(x)* exp(-4*(t-x)); y z

20 Tage ago | 0

how to divide the Dataset into xtrain xtest ytrain ytest
% doc cvpartition data = randn(2310, 25); %cv = cvpartition(2310, 'Holdout', 0.3); %idxTrain = training(cv); %idxTest = te...

21 Tage ago | 1

need to skip iterations in a for loop
L=zeros(1024,1024); % for n=(2:1022:3) % L(1024,n)=1 % end % Set the last row (first end), column 2 to last column wi...

21 Tage ago | 1

| accepted

How to calculate the width that contains 60% of the total area of peaks?
load position load Intensity whos plot(x2, Int); hold on % find the max [maxI, idx] = max(Int); maxX = x2(idx) n = length...

21 Tage ago | 0

| accepted

I need help with plotting
syms t Zc=300; R=100; s=100; v=300/(1*10^-6) tpulssi=s/v k=-1000/tpulssi p=(R-Zc)/(R+Zc) s2=25 tpr=s2/v %heijastuva t...

21 Tage ago | 1

| accepted

Assigning same color for same value at different plots
x{1}=[0.1 0.4 0.6 0.8]; y{1}=[0.2 0.3 0.7 0.9]; name{1}=["A" "B" "C" "A"]; x{2}=[0.1 0.2 0.4 0.6 0.5 0.8]; y{2}=[0.2 0.5 ...

21 Tage ago | 0

| accepted

How do I plot a graph for ϴ for a given range of independent variables?
Assume that r, theta, phi are 3d spherical coordinates. theta is elevation and phi is azimuth. The following is the code to pl...

24 Tage ago | 0

| accepted

I want to create printouts with exact sizes (1=1")
g = figure; g.Units = 'inches'; g.Position = [1 2 3 3]; % 3 by 3 inches plot(rand(10,1)); saveas('test.pdf'); % You ca...

24 Tage ago | 0

| accepted

Trying to understand the single-sided FFT
Assume X(k) = FFT(x(n)). Then one estimate of Power Spectrum Density (PSD) of x(n) can be given as P(k) = X(k)^2 / N for genera...

24 Tage ago | 0

Extract data from a table corresponding to specific time
Save your data into a text file: data.txt x = readtable("data.txt"); a= strrep(string(x.Var1) + " " + string(x.Var2), "'", ...

25 Tage ago | 0

How to plot averaged ROC curve?
% Create sample data numPoints = 50; nCurves = 10; x = sort(rand(numPoints, nCurves)); y = (sort(rand(numPoints, nCurves)))....

25 Tage ago | 0

| accepted

Removing negative values of 3d data
x = load("ggv.mat"); GGV = x.GGV; figure surf(GGV(:,:,2), GGV(:,:,3), GGV(:,:,1), 'EdgeColor', 'none'); xlabel('x'); ylabel(...

28 Tage ago | 0

| accepted

How do I crop out a certain part within a matrix of numbers?
Are you looking for this? A = [1 2 3 4 5 ; 4 9 6 3 9; 2 5 4 1 3 ] B = A(2:3, 3:5) %% More general X = [1 2 ...

28 Tage ago | 1

| accepted

How Can I Resolve Plotting Error?
clc; %clear the console clear all; %clear all the variables %%defitions temp=2000; x_2=0.01:0.01:0.99; % Get th...

28 Tage ago | 0