Risposto
Replace '+-" with '-' in a csv file
% Read data fid = fopen('yourfile.csv'); s = fscanf(fid, '%c', [1 inf]); % read all text from file fclose(fid); % Replace...

circa 3 anni fa | 0

Risposto
How to affix a horizontal subplot below a regular plot?
subplot(3,1,1:2); plot(rand(10,1)) subplot(3,1,3); plot(rand(10,1));

circa 3 anni fa | 0

Risposto
Why does MATLAB's built-in "chol" yield a large error compared to my written algorithm
S=randi([1,100],[25,25]); A=S'*S; B=chol(A) For Cholesky factorization, we have A = B'*B (not B*B'), so we should compute: ...

circa 3 anni fa | 0

| accettato

Risposto
Graph axis with different font types
You can use latex command \rm to set the font: figure (1); plot(rand(10,1)) set(gca, 'Color', 'white'); set(gca,'fontname','...

circa 3 anni fa | 0

| accettato

Risposto
How can I find midpoint in a structure of rows?
a = randn(3, 10); [nrows, ncols] = size(a); [amin, imin] = min(a, [], 2) [amax, imax] = max(a, [], 2) amed = median(a, 2) ...

circa 3 anni fa | 0

| accettato

Risposto
How to plot a path in special order in an complete graph?
A=triu(magic(6)); % adjacency matrix G=digraph(A); % for digraph h=plot(G); % plot graph a = [1...

circa 3 anni fa | 0

| accettato

Risposto
How to adjust the accuracy in graphs ?
h = plot(rand(10,1)); h.DataTipTemplate.DataTipRows(1).Format = '%.6f'; % first line of datatip datatip (h,'DataIndex',3...

circa 3 anni fa | 0

| accettato

Risposto
heatmap function inside a for loop only display the last graph
Create new figure in loop: for i = 3:5 figure heatmap(magic(i)) end

circa 3 anni fa | 0

| accettato

Risposto
How can I re-orient a polar scatter plot so zero is at the top?
th = linspace(0,2*pi,20); r = rand(1,20); sz = 75; figure; subplot(121) polarscatter(th,r,sz,'filled') subplot(122) h =...

circa 3 anni fa | 0

Risposto
Calculate Standard deviation in table
a = array2table(rand(5,8)) % Sample table s = std(a{:, 4:6}, [], 2) % std along rows (dim=2) b = [a table(s, 'VariableN...

circa 3 anni fa | 1

| accettato

Risposto
graph wont display on a simple code
You are plotting point by point. Need to hold on the figure and change the marker for plotting. You may also consider to store...

circa 3 anni fa | 0

Risposto
How can I generate three random matrices from 20 percent of the rows of a 2000 by 80 matrix, using for loop?
a = magic(20); for i = 1:3 idx = randperm(20, 4); % 4 is 20% of 20; for your case 2000*20% b =...

circa 3 anni fa | 1

Risposto
convert hours to days on y-axis
x = [ 1 0 2 0 3 0 4 0.199999999999996 5 0 6 0 7 0 8 0.199999999999996 9 0 10 0 11 0 12 0]; bar(datetime('10/10/2018...

circa 3 anni fa | 1

| accettato

Risposto
Plotting signals discrete with dirac
D = [-1 0 6 8]; % D1, D2 (negative), D3, D4(changed to 8); x1 = [2 -3 3 2]; subplot(311); stem(D, x1); % for dirac ...

circa 3 anni fa | 0

| accettato

Risposto
how to avoid the newline in figure annotation, please help. I give the example code below.
Using cell string, each cell will be in a new line. Change the cell string to char array as follows: rng=10; f1=50; figure ...

circa 3 anni fa | 0

| accettato

Risposto
FFT of acceleration data?
Using fft alone, the spectrum estimate is not smooth. X = randn(4196, 1); N = 256; h(1)=subplot(211); plot(20*log10(1/sqrt(N)...

circa 3 anni fa | 0

Risposto
chirp with carrier frequency using LinearFMWaveform
phased.LinearFMWaveform is a baseband implementation by design for efficiency. The 'frequency offset' is used to modify the swe...

circa 3 anni fa | 0

| accettato

Risposto
How can I find it?
You can use interp1 to interpolate. 'doc interp1' for more details. x = [-0.4 0 0.4 0.8 1.2]; f = [-0.204 -0.07 -0.006 0.442 ...

circa 3 anni fa | 0

Risposto
how to convert (Indian Standard time)IST datetime to UTC ?
s_ist = '15-Sep-2019 13:31:00'; % datetime string for ist d_ist = datetime(s_ist, 'TimeZone', '+05:30'); ...

circa 3 anni fa | 1

Risposto
How to convert IIR filter transposed direct form || SOS to traditional transposed direct form ||?
% Get the filter coefficients (replace a and b with butterworth filter) b = [0.3 0.6 0.3]; a = [1 0 0.2]; % >R2011a: differ...

circa 3 anni fa | 1

| accettato

Risposto
How do I make the x-axis of a signal to represent time?
t=(0:length(y)-1)/fs; plot(t, y);

circa 3 anni fa | 0

| accettato

Risposto
Radians to RPM with diff(..) function
rpmArray = (radiansArray/(2*pi)); minutesArray = timeArray/60; slopeArray = gradient(rpmArray)./gradient(minuteArray);

circa 3 anni fa | 0

| accettato

Risposto
How to use times new roman font (requiring \usepackage{newtxtext,newtxmath}) when using latex interpreter to plot a figure?
If you want latex-friendly plot from matlab, you can try the following package: https://github.com/matlab2tikz/matlab2tikz Th...

circa 3 anni fa | 0

| accettato

Risolto


Word Distance - Sum
Let's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the ...

circa 3 anni fa

Risolto


Split bread like the Pharaohs - Egyptian fractions and greedy algorithm
How would you split 5 loaves of bread among 8 people in all fairness? Get a hint from the Pharaohs. 5/8 = 4/8 + 1/8 , i.e. each ...

circa 3 anni fa

Risolto


Additive persistence
Inspired by Problem 2008 created by Ziko. In mathematics, the persistence of a number is the *number of times* one must apply...

circa 3 anni fa

Risolto


Converting numbers back from extended form
Thanks for all the help you guys gave me on writing out the numbers in extended form in <http://www.mathworks.com/matlabcentral/...

circa 3 anni fa

Risolto


Numbers in extended form
Shhhhhhh. Don't tell my daddy, but I'm borrowing his Cody account so all of you very smart people can help me out. I just star...

circa 3 anni fa

Risolto


Ripping numbers apart!
So you have to "rip" a number apart into individual digits... The end output is a cell. That is if: x = 12345678 o...

circa 3 anni fa

Carica altro