Risposto
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,' ','_'); ...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

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

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

Risposto
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(:)); ...

oltre 7 anni fa | 0

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

oltre 7 anni fa | 0

Risposto
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);

oltre 7 anni fa | 0

| accettato

Risposto
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....

oltre 7 anni fa | 0

| accettato

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

oltre 7 anni fa | 0

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

oltre 7 anni fa | 0

| accettato

Risposto
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) ...

oltre 7 anni fa | 0

Risposto
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,...

oltre 7 anni fa | 1

| accettato

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

oltre 7 anni fa | 0

Risposto
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);

oltre 7 anni fa | 0

| accettato

Risposto
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),...

oltre 7 anni fa | 1

| accettato

Risposto
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);

oltre 7 anni fa | 0

Risposto
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...

quasi 8 anni fa | 0

Risposto
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')}; ...

quasi 8 anni fa | 0

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

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

quasi 8 anni fa | 1

| accettato

Risposto
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...

quasi 8 anni fa | 1

Risposto
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 ...

quasi 8 anni fa | 1

Risposto
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...

quasi 8 anni fa | 1

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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),:);

quasi 8 anni fa | 2

| accettato

Carica altro