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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 2

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

Beantwortet
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

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
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]

mehr als 3 Jahre vor | 0

Beantwortet
Please help me to spot the error.
The error I get is "Unrecognized function or variable 'C12_22'." The cause of the error is that "C12_22" has been misspelled ...

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
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 =...

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 2

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
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); ...

mehr als 3 Jahre vor | 1

Beantwortet
Professor needs specific color for bar graph, but the hex code for the color is not working.
Use 'FaceColor' instead of 'color'.

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 2

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

Beantwortet
How to extract number of matrices with all elements zero and the indexes of those matrices in a struct
% making up some data like yours: gridcell_meancov = struct('grid',struct('mean',num2cell(rand(12,6)),'cov',squeeze(num2cell(ra...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to split dataset into 2/3 for training and 1/3 for testing include plot the graph?
This: Ptest=idx(round(PD*N)+1:end,:);Ttest=idx(round(PD*N)+1:end,:) should be this: Ptest=idx(round(PD*N)+1:end);...

mehr als 3 Jahre vor | 0

Beantwortet
How to Plot an Exponential Process given equation
t= 0:0.1:10; %This is the interval I need concentration= 1.* exp(-1.*t); %This is the equation C(t)= C0* e^-kt plot(t,conce...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Array indices must be positive integers or logical values
You probably mean B.*(L - x) instead of B(L-x) in two places.

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How do I plot multiple vectors in a graph
Like this? A = 1:6; B = 1:6; [Ap,Bp] = ndgrid(A,B); plot(Ap,Bp)

mehr als 3 Jahre vor | 0

Beantwortet
Getting Error while using Transparency to object (alpha)
You have a variable called "alpha" in your workspace, which is preventing you from running the "alpha" function. You should rem...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Can someone find why I get the error: Index in position 2 exceeds array bounds. Index must not exceed 1.
1. Consider the following. Start with x_new as you have it initially: X= [46,52,55,71,32,5,6,11,14;47,56,47,58,59,66,70,72,71];...

mehr als 3 Jahre vor | 1

Beantwortet
Array indexing in matlab
z = reshape(1:30,6,5).' % [] not necessary; 1:1:30 is the same as 1:30; .' is transpose, ' is complex conjugate transpose [z([1...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Unable to find file , load file to xl file .
Two things: 1) You're using y1 = xlsread('F:\matlab\bin_my_excel_file'); % ^ underscore but 'bin' i...

mehr als 3 Jahre vor | 0

Mehr laden