Réponse apportée
change color of bar plot
y = [12 22 23; 21 25 26; 24 18 19; 22 17 15]; h = bar(y,'stacked'); % capture the bar objects into variable 'h' legend({'Set #...

plus de 3 ans il y a | 0

Réponse apportée
Appdesigner, knob value
uiknob 'Value' is a numeric (https://www.mathworks.com/help/matlab/ref/matlab.ui.control.knob-properties.html), so both strcmp c...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
how can i define legend for bar3
bar3(randi(6000,[4,5]).*(1:5)); colors = [0 0.2 0.7; 0.8 0 0.1; 0 0.5 0; 0.5 0 0.5; 0 0.4 0.7]/0.8; colormap(colors) xticklab...

plus de 3 ans il y a | 0

Réponse apportée
find value with row and column
matrix = magic(4) value = 10 [row,column] = find(matrix == value)

plus de 3 ans il y a | 0

Réponse apportée
Sort columns of a table by the value corresponding
% I make a table of random data with 10 columns and 1 row, to represent your table C = num2cell(rand(1,10)); T = table(C{:},'V...

plus de 3 ans il y a | 1

Réponse apportée
Find repeated values of one column and assign the lowest value from the group of second columns
M = [12709.2240000000 -1.23920000000000 12709.2240000000 -1.23530000000000 12780.2225000000 -1.23530000000000 ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Finding the number of digits of the expected value of the codeword in extended Huffman Coding
Instead of this exp_value = exp_value + probVectorSuperSymbols(i) * length(extended_dict(2:i)); Do this exp_value = exp_value...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Make the half note rest for two beats
Looks like this: rest2 = zeros(1,count*dr); should be this: rest2 = zeros(1,count*drest); Otherwise, rest2 is th...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Toggle between temperature units for unit conversion
You need to take into account what the old unit was before it was changed. Fortunately, the ValueChangedFcn of a uidropdown prov...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
I need code for processing of table data
"we start from B2, if mod(B2 - B3) < 0.404 we delete A3B3 and continue to compare B2 with B(i), if B2 - B(i) >= 0.404 we leave t...

plus de 3 ans il y a | 0

Réponse apportée
Plotting a function where the x-axis is also a function
t=0:1:50; v=6.6524*(exp(0.0183993*t)-1); % p=2295000*v(1+0.2647*v); % ^^ missing operator (.*) p=2295000*v.*(1+0...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Errors with imshow function
The image function creates an image object. The imshow function creates an image object and does other stuff to the axes, given...

plus de 3 ans il y a | 0

Réponse apportée
Find data after 'matched' regular expresion in a file
CatalogName = 'SAMPLE.txt'; Catalog = fileread(CatalogName) out = regexpi(Catalog,'NAME (\S+)','tokens'); out{:}

plus de 3 ans il y a | 0

Réponse apportée
How can I make a function from this few lines of codes?
% calling the function defined below filter_and_plot(-40:2:40) % defining the function function filter_and_plot(A) B = A...

plus de 3 ans il y a | 0

Réponse apportée
How can i vary the value of one parameter and plot them on same graph?
One way is to make the function ddems nested inside the function idtry and make k a variable in idtry's workspace; then k will b...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Why there is error in using interp2 while assigning loaded data to the variable?
Try this: S = load("H2.mat"); data = S.data; h = interp2(data.P,data.T,data.H,235e+05,315);

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
I can't find out the answer of conv x(n)=n/4(u(n)-u(n-6)) , h(n)=2[u(n+2)-u(n-3)] using stem function to make a plot.But i shows me conv error.How can I solve it ?
The code runs without error for me. Do you have a variable called conv? If so, that would prevent you from using the conv fun...

plus de 3 ans il y a | 0

Réponse apportée
How to plot z = x^2 * y
You have an extra space between "." and "*" Z = X.^2. * Y; % ^ space breaks up the .* operator That causes Z to be the...

plus de 3 ans il y a | 0

Réponse apportée
How to exclude/extract empty rows/columns in a table?
% read input file into table T T = readtable('test_file.txt'); % get a logical matrix saying whether each element of the tab...

plus de 3 ans il y a | 0

Réponse apportée
Calculate and plot linear amplitude versus linear frequency.
One thing is that you're calling plot with the inputs reversed. The syntax is plot(x,y); in this case, frequency (the variable f...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Operator '*' is not supported for operands of type 'cell'.
Inflow_file = 'oppgave.xlsx'; T = readtable(Inflow_file, 'range', 'A1:A10956') inflow_s = str2double(T{:,1})

plus de 3 ans il y a | 0

Réponse apportée
Automatically identify two numbers within an matrix
matrix = readmatrix('matrix.txt'); matrix_1 = readmatrix('matrix_1.txt'); min_matrix = min(matrix(matrix >= 70)) max_matrix...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
how make a plot where both x and y are varying?
Like this? C = 1:10; % C changing B = 1; % B constant D = 1; A = B.*C.*D; subplot(2,1,1) plot(C,A) xlabel('C') yl...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
x and y ticks in pcolor plots
Set the axes property 'Layer' to 'top' in order to get the grid to show up on top of the pcolor surface. % a pcolor with EdgeCo...

plus de 3 ans il y a | 2

| A accepté

Réponse apportée
I have a code but it keep saying "invalid expression. when calling a function or indexing a variable, use parentheses. otherwise check for mismatched delimiters
It runs without error and shows a plot. Probably there's a syntax error in a nearby part of your code. prob = RollingDice() ...

plus de 3 ans il y a | 0

Réponse apportée
Create box chart with only Min Max Mean and Standard Deviation values
I don't know of a way to explicitly specify the min, max, mean and std of a data set in boxchart (or boxplot). (Note that those ...

plus de 3 ans il y a | 0

Réponse apportée
Is there a command that can check if a string is present in a certain array and output that same string?
I'm confused about what you want the output to be. L = {1, ["Spring", "Summer"]; 0, ["Winter", "Summer","Autumn"]}; ism = ce...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Check/Uncheck box in app designer after opening and closing a secondary figure
See the attached modified app and m-file. See the comments in the code for descriptions of how it works. In addition to the beh...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Multiplication of vectors in for loops
Possibly this: radius = rand(3,3); % contains 9 different values ycenter = 0; anglesRad = [0 1 2]; % I guess this is a 1-by-3...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Plotting within for loop
for r = r(:,1) This redefines the variable r. Before the loop executes, r is a 3-by-7 matrix. After the loop, r will be a 3-by-...

plus de 3 ans il y a | 0

Charger plus