Answered
cell配列に格納されているクラス名によって色を変えて画像を表示するにはどうすればよいですか?
%colors r = [1 0 0]; b = [0 0 1]; %Random data in = {'inu', 'neko'}; idx = randi(2,512,512); in = in(idx); %% If the...

2 years ago | 1

Answered
question about code error
Since you are working with sides, assume the symbolic variable "a" to bepositive. And although angles can be negative, for the g...

2 years ago | 0

Answered
combine bar chart with a line plot
plot expects the inputs as numerical values. You can plot the values directly, for which the x-values will be the corresponding...

2 years ago | 0

| accepted

Answered
how can a symbolic derivative be vectorized automatically?
Convert it to a function handle - syms a b c f = a*sin(b)*exp(c) df = diff(f,b) %Convert the symbolic function to an anonym...

2 years ago | 2

Answered
plot a geographical map
Use geoscatter

2 years ago | 0

| accepted

Answered
Where to find model from example?
You can refer to this particular section of the link you have provided - Required MathWorks Products to know about the products ...

2 years ago | 0

Answered
Replace a variable in a fuction handle by a function
You can directly substitute the expression into the function handle - originalM = @(c,x)(exp(-(0.5+exp(-c(3)+c(4)))*x(:,1).*e...

2 years ago | 0

Answered
Error using 'splitapply' when the first bin has no entries
That is a limitation (for the lack of a better word) of splitapply. Please try this method with accumarray - array = Frequen...

2 years ago | 0

| accepted

Answered
Histogram over occurrences of adjacent equal numbers
As the data comprises of 0 and 1 only, a text based approach works good here - M = [ 1 0 1 0 1 0 1 ...

2 years ago | 1

| accepted

Answered
I need to isolate certain values of a matrix based on whether one of the values fall in a certain range
Here's a general approach - Discretize the data according to the groups and then split then into cells. bins = 0:30:300; idx =...

2 years ago | 1

| accepted

Answered
How to add error bars to a 3D graph
You can plot vertical bars on each data point - x = 0:0.5:10; y = 2*sin(x); z = 3*cos(x); %Define the upper and lower err...

2 years ago | 0

Answered
How do i get the editor window above the command window back on mac?
Go to the Home menu, and change the Layout to the default one.

2 years ago | 0

Answered
Using xlswrite with cell array, how to keep column of numerals as strings?
As you are working with R2023b, use writecell. Note that the use of xlswrite is not recommended.

2 years ago | 0

| accepted

Answered
How do I fill the image completely into the chart in App Designer?
A general solution would be - axis('tight')

2 years ago | 0

Answered
For loop producing correct values but returning zeros
It might look like the values are zero, but they are not. However, compared to the values obtained at the later iterations, th...

2 years ago | 0

| accepted

Answered
How can I extract frequency values of intensity from multiple image files to one Excel file
You have done almost everything correct. However, you are over-writing the excel file with each iteration, thus you will only ge...

2 years ago | 0

| accepted

Answered
Find the closest match between an RGB triplet and a 3d RGB matrix
There are plethora of methods available for comparison. I have used absolute minimum and euclidean norm for example - I am ass...

2 years ago | 0

| accepted

Answered
How can I create 2D graph with three arguments in matlab? Picture with an example chart which i try to create in description.
Use plot. You can refer to the link for the syntax to use the functionality.

2 years ago | 0

Answered
barh, reversing bar colors
Define 'FaceColor' as 'Flat' and assign the color of each stacked bar manually - fig=figure(1); y=[100 120 150 ; 150 120...

2 years ago | 0

Answered
Loop over combinations of elements of several vectors
Use ndgrid - x1 = 1:5; x2 = [2 3 5 7 11]; x3 = [2 4 6 8 10]; %Store vectors in a cell array x = {x1,x2,x3}; n = numel...

2 years ago | 1

Answered
Change the size 2 uiaxes
Experiment with the position values and see which values gives you the best/preferred output. I have posted the values I have tr...

2 years ago | 0

Answered
How to color a region of a plot
You can set the corresponding values to NaN and change the color of the NaN values to white (or rather transparent) - x=linspa...

2 years ago | 1

| accepted

Answered
MATLAB plotting undefined points
An alternative is to use the corresponding numeric functions - figure fplot(@csc, [-10 10], 'b') hold on fplot(@sin, [-10 10...

2 years ago | 1

| accepted

Answered
Sum of all elements of a matrix, whose indices satisfy a condition
Yes. Logical indexing - Find Array Elements That Meet a Condition %Assuming c is vector with atleast n elements and A is nxn a...

2 years ago | 0

Answered
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to reduce operands to logical scalar values.
Double ampersand (&&) are only applicable when the output of each expression used for comparison is a scalar - Short-Circuit AND...

2 years ago | 0

Answered
How to convert images to vectors
From what I have understood - %Random input in = rand(120,160,1,888); s = size(in); %Convert the input to a cell vector ...

2 years ago | 0

| accepted

Answered
plot earthquake locations data on a geotiff file
You should be using geoplot, geoscatter and mapshow/geoshow instead of plot(), scatter() and imshow(). If, even after making th...

2 years ago | 1

| accepted

Answered
fprintf automatic spacing for strings of different lenghts
Vectorized version - %Sample data cities1 = ["Vila Ló", "Pião", "Chão de Frades", "Salmorrete", "Tortolindo"]; cities2 = cit...

2 years ago | 0

Answered
Barh, bars are not correctly displayed.
The bars are centered around the x-positions, thus they are horizantlly distributed. However, you have shown a limited portion...

2 years ago | 0

| accepted

Answered
linsolve for coefficient matrix
You are looking for mrdivide, /.

2 years ago | 2

| accepted

Load more