Answered
How to Import excel document with alot of sheets that does not ignore date in first column
fn = 'Path_to_your_file\MachineLearning.xlsx'; [~,sheet_name] = xlsfinfo(fn); sheet_name = strrep(sheet_name,' ','_'); ...

7 years ago | 0

| accepted

Answered
what should be the program for following output?
>> a0 = {'Sr_no' 'Threshold' 'TP' 'TN' 'FP' 'FN' 'FAR' 'FRR' 'GAR'}; a=[1 0 0 100 0 100 0 1 0 2 0.1 19 100 0 81 0 0.81 1...

7 years ago | 0

Answered
how can i apply 1 of k coding scheme on 2D MATRIX
C = randi([1,3],2,4) [m,n] = size(C); k = max(C(:)); out = zeros(n,k,m); [ii,kk] = ndgrid(1:m,1:n); out(sub...

7 years ago | 0

| accepted

Answered
Finding neighbours in a matrix
Let |a| - your double array. m = size(a)+2; b = nan(m); b(2:end-1,2:end-1) = a; iii = reshape(1:numel(b),m); ii...

7 years ago | 0

Answered
Convert cell array to two row vector
cell2mat(hvix(:)')

7 years ago | 0

| accepted

Answered
sum of consecutive months value in an array
a = [1988 6 223.12 1994 7 1033.0 1994 8 464.67 1995 9 251.33 1997 6 121.41 1997 8 624.58 1999 9 221.60 20...

7 years ago | 0

| accepted

Answered
table name res5500 ,row size 762,three column, third column each row have different length,compare the value of each row is same or different. count number of same row and different row, please help me
f = fopen('path_to_file\res_5500.csv'); c = textscan(f,'%s','delimiter','\n'); fclose(f); n = cellfun(@numel,re...

7 years ago | 0

Answered
How do I create a loop to increment the number of terms of a function?
m = @(x)1+a(:).'*(x - b(:)) use >> a = [1 2 3 4 5]; b = [6 7 8 9 10]; m = @(x)1+a(:).'*(x - b(:)); ...

7 years ago | 0

Answered
why do I need to add eps ?
To avoid the uncertainty of |"0/0"| situation when calculating |z|. When |x = 0| and |y = 0|.

7 years ago | 0

Answered
array indexing with repeated index, index size larger than the array
One way: A = {'a' 'b' 'c' 'd'}; I = [1 1 3 1 1 1 2 2 1]; B = A(I);

7 years ago | 0

| accepted

Answered
What is wrong with this code?
for ii = 1:8760 if v(ii)<vci || v(ii)>vco P(ii)=0; elseif vci<=v(ii) && v(ii)<vr P(ii)=(0....

7 years ago | 0

| accepted

Answered
How do convert array x to array z?
or just: [~,~,z] = unique(x,'stable'); or more [~,z] = ismember(x,[4 8 5]);

7 years ago | 0

Answered
how to reverse an integer
flip(sprintf('%d',4530),2)

7 years ago | 0

| accepted

Answered
how to take a matrix of certain values taken from the matrix
q = 125; [~,inx] = mink(abs(A(:,2) - q),2); B = A(inx,:); or for old MATLAB q = 125; [~,inx] = sort(abs(A(:,2) ...

7 years ago | 0

Answered
Get the max value and the indices of max value across a series of matrices
Let A - your cell array (25 x 50) with double matrix 128 x 128. n = size(A,1); maxvalue = cell(n,1); maxidx = cell(n,...

7 years ago | 1

| accepted

Answered
how to have a vector that counts how many repetitive numbers there is in another vector?
out = [(1:51)',histcounts(A,1:52)']

7 years ago | 0

Answered
how can i create 12 monthly maxima from a uniform distribution between 0 and 6? (using unifrnd)
R = unifrnd(a,b(end),[1,12]); or R = rand(1,12)*b(end);

7 years ago | 0

| accepted

Answered
Collapsing data that are within one integer value of each other
n = diff(z(:)) == 1; lo = [n;0] | [0;n]; nn = [diff([0;n]) == 1;0]; nn(~lo) = 1; out = ceil(accumarray(cumsum(nn),...

7 years ago | 1

| accepted

Answered
How to merge adjacent NaN values into single NaN value in a vector?
a = [1 2 3 NaN NaN 0 1 2 NaN 9 8 7 6 NaN NaN NaN 1 1]; lo = ~isnan(a); lo(strfind(lo,[0 1])) = true; out = a(lo);

7 years ago | 0

Answered
Sir, am having the four mat files, which of two contains features from minutie and other two contains feature from invarient moment, can i make fusion of those features by combining it then how?
V = {load('db1.mat'),load('db2.mat'),load('db3.mat'),load('db4.mat')}; n = cellfun(@fieldnames,V,'un',0); V1 = cellfun...

7 years ago | 0

Answered
Error in following code while converting cell to matrix
fusion = cell2mat(cat(1,out{:})); or just V = {load('db1.mat'),load('db2.mat'),load('db3.mat'),load('db4.mat')}; ...

7 years ago | 0

Answered
How to create matrix from descending number of vector elements without loop?
A = [1 2 5 3 4]; n = numel(A); out = ones(n,1)*A.*flip(triu(ones(n)),2); or just ( |MATLAB >= R2016b|) out = A...

7 years ago | 0

| accepted

Answered
How can I select rows based on the value in a specific column and calculate the mean of those rows for all other columns to create a new table containing just the means?
TT = table2timetable(Port1a(:,2:end),'RowTime',datetime(Port1a{:,1})); out = varfun(@mean,TT(:,[1:20,end]),'GroupingVariabl...

7 years ago | 0

| accepted

Answered
Converting a 3D matrix into a 2D in the correct order.
permute(T,[3,2,1])

7 years ago | 1

| accepted

Answered
find data in array
i1 = find(header(:)==53); p = hankel(header(1:end-1),header(end-1:end)); i2 = find(ismember(p,[53*ones(4,1),(0:3)'],'row...

8 years ago | 1

Answered
Import excel sheet, multiply each column with a variable, and save the results as a new cell array
>> d d = 1 1 1 2 2 2 3 3 3 1 1 1 2 2 2 3 3 ...

8 years ago | 1

Answered
How to find the neighbors of each element in a matrix
s = size(A); B = zeros(s); n = numel(A); out = cell(s); for ii = 1:n B(ii) = 1; out{ii} = A(bwdist(B,'ch...

8 years ago | 1

Answered
How to Convert milliseconds to dd:mm:yyyy hh:mm:ss?
T = datetime(1970,1,1,0,0,0,0,'TimeZone','UTC','F','uuuu-MM-dd''T''HH:mm:ss.SSS Z'); addMS = milliseconds(cumsum([0;randi(2...

8 years ago | 0

| accepted

Answered
How to remove duplicate rows from a matrix?
[~,b,c] = unique(Results(:,1:5),'rows','stable'); out = Results(b(histcounts(c,1:numel(b)+1) == 1),:);

8 years ago | 2

| accepted

Load more