Community Profile

# Voss

Last seen: Today Attivo dal 2013

All

#### Content Feed

Visto da

Risposto
Click items in the legend to show or hide the associated line in plot
freq = 1:10; eps1 = rand(10,1); eps2 = rand(10,1); eps3 = rand(10,1); figure plot(freq,eps1); hold on; plot(freq,eps2);...

circa 14 ore fa | 1

| accettato

Risposto
How to replace duplicate elements with the elements of the second array?
Maybe something like this? a = [23 34 56 78 100 10 12]; b = [2 2 2 4 6 0 0 11 11 11 6];% contains repeating elements yougo...

circa 15 ore fa | 0

| accettato

Risposto
How to extract specific data from a .txt file
type FILE.TXT % show the contents of FILE.TXT, for reference data = readlines('FILE.TXT'); % read the file Here's one way to g...

circa 17 ore fa | 1

Risposto
one matrix that is made from multiple vectors of different lengths that don't start at the same point
Assuming data{1,10} is a row vector (i.e., the cell data(1,10) contains a row vector), then the following would work: M(10,5570...

circa 18 ore fa | 0

Risposto
reset pareto chart on App Designer
pareto creates a new axes and returns the two axes as the second output. You can store that new axes and cla(_,'reset') it along...

circa 20 ore fa | 0

Risposto
Color in white only pixels defined by a matrix [rx2]
BW = imread('blobs.png'); imshow(BW) r1 = 163; c1 = 37; contour = bwtraceboundary(BW,[r1 c1],'W'); hold on plot(contour(:,...

circa 20 ore fa | 0

| accettato

Risposto
Exponential approximation for vector input
vect = [-5.0000 -5.0000 -5.0000 1.0000 0.9000 0.8000 0.7000 -5.0000 -5.0000]; Using / (matrix right divisi...

circa 20 ore fa | 0

Risposto
I have a list of objects in matrix A and object list and their corresponding masses in matrix B.Howto generate a matrix containing masses of objects present in orderof matrxA
A = ["C"; "A"; "E"; "F"; "I"] B = ["A", 1;"B", 34;"C" 56;"D" 32;"E",11;"F",8;"G", 7;"H",9;"I" 77] [ism,idx] = ismember(A,B(:...

circa 21 ore fa | 0

| accettato

Risposto
x1 = cos(2*pi*4*t); , x2 = cos(2*pi*12*t), x3 = cos(2*pi*16*t), x4 = cos(2*pi*28*t) Plot the continuous-time waveforms x1(t), x2(t), x3(t) and x4(t) over a 1-second interval
t1 = linspace(start_time,end_time,number_of_samples) For example, to use 100 samples over a one-second interval starting at t =...

circa 21 ore fa | 0

Risposto
How to break data in to groups using while loop?
"Is it possible to do this using a while loop?" matrix = [1 50 60 70 50 40 2 NaN 10 20 10 10 3 NaN 20 NaN NaN NaN ...

circa 21 ore fa | 0

Risposto
How to break data in to groups using while loop?
matrix = [1 50 60 70 50 40 2 NaN 10 20 10 10 3 NaN 20 NaN NaN NaN 1 NaN 60 30 40 50 2 10 20 10 20 NaN 1...

circa 21 ore fa | 0

Risposto
How to label the numeric values at the end of a stack in a stacked bar graph?
Something like this? Y1 = [1 2 0 4]; Y2 = [2 4 6 0]; Y = [Y1; Y2]; Bin = bar(Y,'stacked'); xt = get(gca, 'XTick'); set(gca...

circa 22 ore fa | 1

Risposto
How can I save figures when created in a loop?
This won't work for a couple of reasons: sprintf('C:\my\directory\...\Count_missing_values%d.fig',S(k).name) backslash (\) is ...

circa 22 ore fa | 1

| accettato

Risposto
Zoom in on a section of a graph
xlim([9.5 10])

3 giorni fa | 2

| accettato

Risposto
How to define the location/position of a number in a specific cell array?
idx = find(cellfun(@(x)isequal(x,1),MY));

4 giorni fa | 0

Risposto
data extract from array or vector
data = rand(96,1); % 96-by-1 column vector for ii = 1:12 subset = data(ii:12:end); % do something with su...

4 giorni fa | 1

Risposto
Variables in for loop not updating in following iterations
The loop has only one iteration because N is a scalar for x=N To loop N times, you can use for x=1:N

4 giorni fa | 0

| accettato

Risposto
is there any one line code for writing in this way? if it's please give me a way to write this.
T = [0 0.0018 0 0.0012; 0.0018 0 0.0025 0; 0 0.0025 0 0.0015; 0.0012 0 0.0015 0]

6 giorni fa | 0

Risposto
The error I get is "Unrecognized function or variable 'C12_22'." The cause of the error is that "C12_22" has been misspelled ...

8 giorni fa | 0

Risposto
Exceeds the number of array elements (0).
Either img or bounds (or both) is empty. Check img and bounds and figure out why one or both is not what you expect.

8 giorni fa | 0

| accettato

Risposto
Warning message when creating surface plot.
You probably mean to use element-wise multiplication and division, in order to get a matrix Z the same size as X and Y: Z =...

10 giorni fa | 0

| accettato

Risposto
a = b<0
a = b<0; checks if b is less than 0 and stores the result in a. If b is a scalar: if b is less than 0, then a will be true; ot...

10 giorni fa | 2

| accettato

Risposto
Sprintf warning message on a function file
The warning is saying that, if all you do with the result from sprintf is to display it with disp, then you can display it with ...

10 giorni fa | 1

| accettato

Risposto
How to iterate a structure name and save directory in a for loop?
saveDir = 'my/path/name'; cnt = 50; for j=1:10 cnt = cnt+50; S = struct('minTime',tmin,'maxTime',tmax); ...

10 giorni fa | 1

Risposto
Professor needs specific color for bar graph, but the hex code for the color is not working.

11 giorni fa | 0

Risposto
How to find out how many participants are in each group of my combined matrix (31230x5)
% some data like yours with participant IDs in column 1 % and group ID in column 2: data = [randi(40,31230,1) randi(8,31230,1...

11 giorni fa | 0

Risposto
Plot clear using MATLAB app designer.
cla(app.UIAxes, 'reset') https://www.mathworks.com/help/matlab/ref/cla.html

12 giorni fa | 1

| accettato

Risposto
Next value in alphabet
nextLetter('d') nextLetter('s') nextLetter('z') % no next letter after 'z' -> error function next = nextLetter(letter) Alp...

14 giorni fa | 0

Risposto
Hiding exponent labels without scientific notation
Set the xticklabels when you set the xticks.

14 giorni fa | 0

| accettato

Risposto
how to plot two graphs using a matlab?
semilog should be semilogx, and holf should be hold % semilog(x1, wattdis) %% I cannot plot this one. semilogx(x1, wattdis) ...

16 giorni fa | 0