Answered
How to get the best combination of element to approach a value?
Use this file exchange: https://www.mathworks.com/matlabcentral/fileexchange/11462-n_permute_k to get different permutations of ...

6 years ago | 0

Answered
Post processing data and make contour plot: Error using contour (line 48) Z must be at least a 2x2 matrix to plot contour lines
Let A be your 384000*3 matrix. x = A(:,1) ; y = A(:,2) ; z = A(:,3) ; %%structured xi = unique(x) ; yi = unique(y) ; [X,Y]...

6 years ago | 0

Answered
Plot text with numbers
[num,txt,raw] = xlsread("test.xlsx") ; % can also use readtable plot(num) xticklabels(txt)

6 years ago | 0

Answered
How can I get correct M array?
Wont this simply work for you? K=100; X = rand(K) ; x = X<=0.15 ; m = mean(x) ;

6 years ago | 0

Answered
Get array possition from mat file
load("final.mat") val = 6 ; % the value which you seek idx = find(C==val) ; % gives global indices [r,c] = ind2sub(size(C)...

6 years ago | 0

Answered
Coin flip combinations probabilities
You can generate combinations using: R = [0 1] ; % 0 is T, 1 is H iwant = zeros([],3) ; count = 0 ; i = 0 ; while c...

6 years ago | 0

Answered
subtracting specific component of matrix from another one
Read about diff Co_system = [0 0 2 0 2 0 5 4]; d = diff(Co_system)

6 years ago | 0

Answered
CurveFit on Vector Data Points
b_reference_1 = [485.9;251.975;358.55;313.6565;85.322;193.4422;53.425;106.66;71.88;84.8653]; Y_1 =[1;1;1.31;1.31;1.89;2;1.45;1....

6 years ago | 0

Answered
Least square method for a circle
https://www.mathworks.com/matlabcentral/fileexchange/5557-circle-fit

6 years ago | 0

| accepted

Answered
hi i need to do heatmap and have some problem with histcounts functions and the map
You have to save the values into a matrix in loop, which you are not doing. bins=50; Accumulated_Prob=zeros(bins,length(d)); ...

6 years ago | 1

| accepted

Answered
How to interpolate an intermediate curve from curves with different number of data points?
data = xlsread("Data.xlsx") ; t = data(:,1) ; strain = data(:,2) ; stress = data(:,3) ; % [c,ia,ib] = unique(t) ; ...

6 years ago | 0

Answered
New to MATlab-how to fix '^' error
Read about element by element operations. You have to replace ^ with .^. Error is clear. Apart from .^ you need to use ./. v =...

6 years ago | 0

| accepted

Answered
modify code for polynomial function
n = length(p)-1 ; % degree of polynomial val = sum(p.*(x.^(n:-1:0)))

6 years ago | 0

Answered
How can I add all the differents additions to one scalar output?
x = rand(3,1) ; y = rand(3,1) ; z = rand(3,1) ; N = length(x) ; v = 0 ; for i = 1:N v = v+x(i)^2+y(i)*z(i) ; end

6 years ago | 0

Answered
How do I iterate if I have points from [-20,5,0] to [20,5,0]?
clc; clear all ; x1 = -20 ; y1 = 5 ; x2 = 20; y2 = 5 ; t = linspace(0,1) ; x = x1+(x2-x1)*t ; y = y1+(y2-y1)*t ;

6 years ago | 0

Answered
how can i get screenshot continuously by pressing key?
a = imaqhwinfo; vid = videoinput('winvideo',1); set(vid, 'FramesPerTrigger', Inf); set(vid, 'ReturnedColorspace', 'rgb') vid...

6 years ago | 0

Answered
Why does this if statement fail?
for Thr=0.4:0.1:0.7 disp(Thr); if abs(Thr-0.5)<10^-3 disp('but I am here?'); end if abs(Thr-0.6)<10...

6 years ago | 0

| accepted

Answered
How to save characters in a position instead of the position value in an array
iwant = num2cell(str1(rem))

6 years ago | 0

| accepted

Answered
How to create a montage
You can split your image into 5*4 sub matrices using the below link: https://www.mathworks.com/matlabcentral/answers/362262-i-h...

6 years ago | 0

Answered
How i can reorder the sheets of excel in matlab to do a same sheet ?
clear;clc; Cyears = 9; Cdays = 31; % Enero iwant = zeros(144,31,9) ; for i=1:Cyears RS = xlsread('REN.xlsx',i); ...

6 years ago | 0

| accepted

Answered
how to plot curve in matlab
Are you looking for something like this? qa = linspace(-pi,+pi,200) ; % give your ranges f= linspace(-115,115,200) ; % give...

6 years ago | 0

Answered
How to change the intensity of a circle/ring in an image?
m = 256 ; n = 256 ; I = 100*ones(m,n) ; % center of image [X,Y] = meshgrid(1:n,1:m) ; C = [mean(1:n) ,mean(1:m)] ; th...

6 years ago | 1

| accepted

Answered
interpolating matrices between rows
You attach your data as a text file or mat file. Image snippet cannot be used to work.

6 years ago | 0

Answered
How to create a new matrix from all possibe row combinations?
% Create a matrix randomly picking rows from a Matrix m = 10; n = 5 ; % size of given matrix A = rand(m,n) ; mi = 5 ; % p...

6 years ago | 0

Answered
interpolating matrices between rows
Read about griddata and scatteredinterpolant functions.

6 years ago | 0

Answered
How can I plot the indices of observation in class 1?
load tremor(1).mat ; id1 = ttr==0 ; id2 = ttr == 1 ; plot(Xtr(id1,1),Xtr(id1,2),'*r') ; hold on plot(Xtr(id2,1),Xtr(id2...

6 years ago | 0

Answered
How can I plot data on the indices of observations?
Read about gscatter. https://www.mathworks.com/help/stats/gscatter.html id1 = ttr == 0 ; id2 = ttr == 1 ; scatter(Xtr...

6 years ago | 0

Answered
Make a 2D Plot with 3 variables
Read about contour, countourf, pcolor. [X,Y,Z] = peaks(100) ; figure pcolor(X,Y,Z) ; sjading interp ; colorbar figure con...

6 years ago | 0

Load more