Risposto
Sign minus, not hyphen
c1 = '−'; % (UTF-16: 2212), not -. c2 = '-'; s1 = "both − and -" s2 = strrep(s1, c1, c2) contains(s1, c1) contains(s2, c1...

circa 2 anni fa | 0

Risposto
Storage many same dimension matrixes to one matrix
Try to avoid eval. Use N-D array or cell array instead. n=10; %100000 x = zeros(4, 4, n); for i = 1:n x(:,:,i) = ifft...

circa 2 anni fa | 0

| accettato

Risposto
Number of Layers in Googlenet
The definition of layers in general literature is different from that of MATLAB layers. For example, the usual "convolution" la...

circa 2 anni fa | 0

| accettato

Risposto
concatenate matrix with zeros function
The code "TxRxPairs = zeros(ants_pairs.Length,2)" is correct. It has the function name "zeros" followed by the arguments inside...

circa 2 anni fa | 0

Risposto
Load multiple files to MATLAB without changing name manually
% list the files to be processed fn = dir("signal*.csv"); for ifile=1:length(fn) current_fn = fn(ifile).name; % [fil...

circa 2 anni fa | 0

| accettato

Risposto
How can I find rank of matrix?
% Get the coefficient matrix of the system A = [ 7 6 9 2 7 1 3 2 2 1 5 5 6 4 ...

circa 2 anni fa | 1

Risposto
Need help with Contour plot
x = [1 0.975744 0.294546 0.192422 0.155833 2 0.956922 0.172609 0.112765 0.089115 3 0.950648 0.131963 0....

circa 2 anni fa | 0

| accettato

Risposto
Newton's method
https://en.wikipedia.org/wiki/Newton%27s_method R = 5; % input f=@(x) x.^3 - R; % f(x) = 0 df=@(x) 3*x.^2; ...

circa 2 anni fa | 0

| accettato

Risposto
OnRamp Example Question/Troubleshooting
You should type "y = [7 9]" only. The second and third lines is the output of the command when you run it and they are not matl...

circa 2 anni fa | 0

Risposto
Plotting of a cell array
a = rand(12,10)+4; b = rand( 5, 12)+3; c = rand( 4, 9)+2; d = rand( 10, 15)+1; M = {a,b,c,d}; % Cell Array p = 3; % for ho...

circa 2 anni fa | 0

Risposto
How can I skip empty cells when averaging during a function?
load explained_balls whos for i = 1:length(explained_balls) %explained_balls{i} if isempty(explained_balls{i}) ...

circa 2 anni fa | 0

Risposto
Index in position 1 exceeds array bounds.
It seems that your code works well. Can you show how the error occurs? x = randn(4, 5) F_ransac(x) function [epsilon, p, tol...

circa 2 anni fa | 0

Risposto
FFT of an ASK signal
plot the abs of fft. fb=1000; %frecuency of the square signal Tb=1/fb; fs = 999/Tb; %t=0:Tb/999:7*Tb; %time vector t=0:1/fs...

circa 2 anni fa | 1

| accettato

Risposto
Hex to Num / Hex Cell Array
x ={'3A', 'F1', 'CF', '4C'} y = cellfun(@hex2dec, x)

circa 2 anni fa | 0

| accettato

Risposto
How to write the string after a spesific point in cell array?
s = 'ASDASDDSA 123213213 ASDADASDA 18128, ASDSAD [ 123 123 123 12 3 123123 123 123]' t = regexp(s, '\[[\d\s]*\]', 'match')

circa 2 anni fa | 0

Risposto
Unable to add coastlines to SST plot
unzip('sst_data.zip') %dir filename="sst_data.cdf"; %ncdisp(filename); long=ncread(filename,'COADSX'); lat=ncread(filename,...

circa 2 anni fa | 0

| accettato

Risposto
How to apply STFT and convert it into Time frequency Image In MATLAB
load frame8PSK001 whos nfft=128; % doc spectrogram for more details spectrogram(frame, hamming(nfft), nfft/2, nfft, 'centere...

circa 2 anni fa | 0

Risposto
how to plot histogram
load Xdata % whos figure; imshow(Xdata); unique(Xdata(:))' imhist assumes Xdata in the range of [0,1]. Therefore you have o...

circa 2 anni fa | 1

| accettato

Risposto
Crack Detection Annotation Issue
1、The length of the crack I marked at the midpoint of the line segment: Use horizontal alignment plot([coord1(1), coord2(1)],[c...

circa 2 anni fa | 0

Risposto
Growing eye matrix as per the size of eye
a = tril(repmat(eye(3), [3, 3]))

circa 2 anni fa | 1

| accettato

Risposto
2 x axis log scale and 1 y axis
% generate some data dollarlost = logspace(4, 12, 81); p3 = 1e5./dollarlost; p2 = 1e4./dollarlost; p1 = 1e3./dollarlost; ...

circa 2 anni fa | 0

| accettato

Risposto
Hi, I want to eliminate duplicates in a cell array in Matlab
T = {[1 2 5], [1 2 5], [1 3 5], [1 4 5], [2 4 5], [4 6]} Tu = T(1) for i=2:numel(T) toAppend = true; for j=1:nu...

circa 2 anni fa | 0

Risposto
How can I create a correlation graph
% data matrix nv = 10; % number of variables ns = 80; % number of samples x = randn(ns, nv); % Correlati...

circa 2 anni fa | 0

Risposto
how to plot correlation matrix shown by colored circles?
% Generate R n= 6; r = magic(n); r = triu(r); r(r==0) = NaN % Plotting [xx, yy] = meshgrid(1:n, 1:n); scatter(xx, yy, r*2...

circa 2 anni fa | 1

| accettato

Risposto
How to converting complex numbers to absolute values?
a = readcell('sample data.csv'); a{1} = 'NaN' b = zeros(size(a)); for i=1:numel(a) if isnumeric(a{i}) b(i) = ...

circa 2 anni fa | 0

Risposto
Getting "Unrecognized function or variable 'reshape'" error!!
%reshape([1 2 3 4],:,1); reshape([1 2 3 4], [], 1) % use [] for auto computed size

circa 2 anni fa | 0

Risposto
create 256* 256 matrix with loop values 0 to 7
x = repmat(0:7, 256, 32)

circa 2 anni fa | 0

| accettato

Risposto
In the follow screenshot why do we use this filter to our signal I ?
You have a discrete linear system. You could find the system transfer function by analysing the system. It turns out to be a f...

circa 2 anni fa | 0

Risposto
Extracting data from confusion matrix fig
f = openfig('SqueezeNet-CM', 'visible'); h = findobj(f.Children(2).Children, 'Type', 'Text'); data = zeros(length(h), 1); for...

circa 2 anni fa | 0

Risposto
How to write Exponential growth
x1 = logspace(0, 5, 11) % 11 points btw 10^0 and 10^5 in log space x2 = 10.^(0:.5:5)

circa 2 anni fa | 0

Carica altro