Community Profile

photo

DGM


Last seen: Today Active since 2015

Hi, I'm nobody.
I don't belong here, but I have nothing better to do.
Matlab used to be part of my work.
Now it's part of my hobbies.
That's pretty sad, really.

Statistics

All
  • 6 Month Streak
  • Guiding Light
  • 5-Star Galaxy Level 4
  • Revival Level 3
  • Knowledgeable Level 4
  • Explorer
  • Thankful Level 2
  • First Answer
  • Personal Best Downloads Level 3
  • First Review
  • First Submission

View badges

Content Feed

View by

Answered
How to compare two columns of every row and display them?
Well, this is what I did. % PART 2 M = [1042 713 4 42; 30 48 0 12; 4 160 12 1; 1 111 2 0] extra = M(:, 4); sum3col = sum(M(:...

11 hours ago | 0

Answered
I'm getting this as error on 2nd line --> Index in position 2 exceeds array bounds (must not exceed 1).
The functional syntax for load behaves differently than the command syntax. Say you have a matfile containing arrays X,Y, and Z...

11 hours ago | 0

Answered
how can i contour level control use with 'plot'
You can set the LevelList property x=[1200 1200 1200 1200 1100 1100 1100 1100 1000 1000 1000 1000 900 900 900 900]'; y=[-2 -1 ...

12 hours ago | 0

| accepted

Answered
how to use ismember() to check if an inputted number exists in a matrix.
This might be a start: % read file as table, since a matrix can't hold both datatypes Data = readtable('NaiveBankData.csv'); ...

15 hours ago | 0

Answered
Comparing elements of cell arrays
Well, I bet there's a more elegant way than this, but this seems to work. p = {[12 11 13 9]}; % denotes a route with links 12-1...

18 hours ago | 0

| accepted

Answered
How to write a video file without changing the pixel values?
As far as I know, no. Anyone is free to correct me on that. I don't know of any common formats for lossless video that use flo...

21 hours ago | 1

Answered
image analysis to find pH strip and determine pH
Not knowing what any of the other images look like or what other colors need to be accomodated, it's kind of hard to make anythi...

23 hours ago | 0

Answered
Illegal use of reserved keyword "else".
Start with function q_P = ParticularSolution (K,M,f_0,t,w_R,roadflag) Q = [-K,-w_R*M,w_R*M,-K]; % fix imbalanced brackets ...

1 day ago | 0

Answered
Creating a plot that changes colour as the month changes
I answered a very similar question yesterday, iirc. https://www.mathworks.com/matlabcentral/answers/1599669-for-loop-which-cha...

1 day ago | 1

| accepted

Answered
Converting RGB Image to Grayscale Intensity on arbitrary Colormap
Something like this might be a start: % you already found a colormap cmap = parula(64); % generate false-color test image ...

2 days ago | 0

Answered
Splitting a Colorbar into 12 parts according to months from data
If you're doing a line plot, it may make more sense to just use a legend. % the selected colormap cmap = jet(12); % dummy d...

2 days ago | 1

| accepted

Answered
Display L*A*B space channels separately
Lemme try that again... RGB = imread('peppers.png'); [L A B] = imsplit(rgb2lab(RGB)); Lfill = 50*ones(size(L)); % pick some...

2 days ago | 0

| accepted

Answered
Why I do not get the graphics as I want. It is not a code problem
You have to plot more than one data point. load DataRaval2.mat load TempRaval2.mat for k = 1:48:numel(TempRaval) ...

2 days ago | 1

| accepted

Answered
I have to combine 90 txt files in one txt file
This is a start. In this simplified example, there are three files, each with three lines. You might have to tweak the delimit...

2 days ago | 0

Answered
can someone please tell me how to colour the mark area A,B,C,D?
Something like this: x1=[0.8043 0]; y1=[0 0.0789]; x2=[0.8407 0]; y2=[0 0.0825]; x3=[0.8726 0]; y3=[0 0.0890]; x4=[0.1 0....

2 days ago | 1

Answered
Heatmap log colour scale: caxis() doesn't map values correctly?
You're expecting that caxis expects log10(limits). It's actually expecting the natural log. % Create log values and generate h...

2 days ago | 1

| accepted

Answered
How to display a 256x256 image from .mat file?
Almost had it. S = load('GrayScaleMRI.mat'); imshow(S.GrayScaleMRI) When using the functional syntax for load(), the output...

2 days ago | 0

| accepted

Answered
How can I plot xticklabels from a 3-column matrix?
You can try something like Adam's answer here: https://www.mathworks.com/matlabcentral/answers/101922-how-do-i-create-a-multi-l...

3 days ago | 1

| accepted

Answered
Trying to increase marker size in scatter plot caused my plot and data to be replaced by a blank blue screen.
You're dealing with 2D data, so ideally you'd be using 3 dimensions to visualize it. That said, there are only 2 unique values ...

3 days ago | 0

Answered
File Installation Key Freezes during install
The broken UI elements is a longstanding bug. https://www.mathworks.com/support/bugreports/1797911 https://www.mathworks.com...

3 days ago | 0

Answered
Add random numbess to matrix
Define "add 1-5% of its actual value to it" Consider an array A. Does this mean % random factor is scalar B = A + (0.01+0.04...

3 days ago | 0

| accepted

Answered
I don't know how to write the following problem: f(x)=2x^3-15.4x^2+2.7x+2.25 - Determine the area under f(x) on the interval [-1,8]. Use the zeros rounded to one decimal
This can all be done symbolically easily enough xrange = [-1 8]; syms x f = 2*x^3 - 15.4*x^2 + 2.7*x + 2.25; area = int(f,x,...

3 days ago | 1

Answered
HOW TO PUT ONE MATRIX UNDER ANOTHER AND MAKE IT A SINGLE MATRIX
A = [1 2 3;4 5 6;7 8 9] B = [1 2 2;2 2 2;1 1 1] % concatenate C = [A; B] % or C = cat(1,A,B)

3 days ago | 0

| accepted

Answered
I want column matrix in for loop
I'm not sure, but this might be close to what you want. n=10 xrange = 11:13; yrange = 11:13; for k = 1:(n-1) image1...

3 days ago | 1

Answered
for loop which changes color depending on the month
I don't have your data, so I just have to assume some placeholder data instead. It's probably better to use a legend for identi...

3 days ago | 0

Answered
croping of an image without imcrop
Don't save displayed images; save the image itself. imwrite(I2,'E:\UB\MATLAB\X\1.png'); Saving a displayed image is tantamou...

3 days ago | 1

| accepted

Answered
How to use mean2 and skip some rows?
What's wrong with just mymean = mean(yearly_data_matrix(5:end,11)); since you're extracting a vector, I don't see the need for...

3 days ago | 0

| accepted

Answered
While loop not working
Your if statements don't do anything when they test true. That should all be one if-elseif structure because the cases are all ...

4 days ago | 0

Answered
Single value in colors vector causes error in scatter plot
The code you give works fine in the newest version that I have (R2019b), but not in R2021b. I'm not exactly sure what changed, ...

4 days ago | 1

| accepted

Answered
Colormap always shades of blue
You're not specifying your colormap length. If you don't do that, colormap() will create a map equal to the length of the curre...

4 days ago | 0

| accepted

Load more