Respondida
How to solve for x give the equation of a circle and the equation of a line?
Consider the example of finding the intersection of a parabola and a circle. Note that this can all be done with the equations ...

más de 4 años hace | 1

Respondida
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(:...

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 1

| aceptada

Respondida
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'); ...

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 1

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 1

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

más de 4 años hace | 2

| aceptada

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 0

| aceptada

Respondida
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,...

más de 4 años hace | 1

Respondida
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)

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 1

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

más de 4 años hace | 0

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

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 0

Respondida
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, ...

más de 4 años hace | 1

| aceptada

Cargar más