Answered
3D plot of 3 vectors
You first need to convert your data into a grid format using scattered interpolation x = data(:,1); y = data(:,2); z = data(:...

2 jours ago | 0

| accepted

Answered
How to use For loop or any other loop to rearrange elements in a matrix using Matlab?
Try this M = readmatrix('Boundary_closed_1s_3s.txt'); for i = 1:size(M,1) idx1 = find(M(i,:), 1, 'first'); idx2 = ...

2 jours ago | 1

Answered
How to add values at blue dots in graphs?
There is no general way. You can use text() to place the values, but to customize the location will require manual tweaking. For...

2 jours ago | 0

| accepted

Answered
how to make if accept letters?
Several problem: 1. = is an operator for assignment in MATLAB. For comparison, you need to use == if yesno == y 2. You want t...

2 jours ago | 0

| accepted

Answered
Property validation for a vector
You can use mustBeVector validation function. properties Col {mustBeVector} end Functions are listed here: h...

3 jours ago | 0

| accepted

Answered
1x2 Cell with each ?field? containing 2 values
You have 'a' like this a = {[1 2], [3 4]}; To access first elemets, you need to use indexing like this a{1,1}(1) a{1,2}(1) ...

3 jours ago | 1

Answered
Indexing of a size() object
Unlink some other languages, such a chain of indexing is not supported in MATLAB. You can find the discussion on this issue on t...

3 jours ago | 1

| accepted

Answered
arg min for Optimization problem
You can use fminunc(): https://www.mathworks.com/help/optim/ug/fminunc.html or fmincon():https://www.mathworks.com/help/optim/ug...

3 jours ago | 0

Answered
add labels to x axis
Add this line at the end of your code xticklabels(X)

3 jours ago | 0

| accepted

Answered
Problem in putting limit to the variable
'x' is already in this range. You are printing the value of 'extreme_values', not 'extreme_points' syms x f=0.3*(x-0.6)*(x-0.9...

3 jours ago | 0

Answered
How can we do for following fprintf formating
It is not possible to do such thing in command window currently: https://www.mathworks.com/matlabcentral/answers/255568-putting-...

3 jours ago | 0

Answered
Create matrix with two matrices
You can do something like this A = [1 2 3; 4 5 6;7 8 9]; B = [ 11 12 13;14 15 16;17 18 19]; Matrix = zeros(size(A,1)+size(B,1...

3 jours ago | 0

Answered
How to create a Nx3 array from Nx4 array
You can use cellfun() C1; % 100x1 with Nx4 matrices C2 = cellfun(@(x) {x(:,2:end)}, C1);

3 jours ago | 0

| accepted

Answered
Non-linearly spaced axis
You need to set the xscale to 'log'. Run the following line after creating the plot xlim([0.01 1000]) set(gca, 'XScale', 'log'...

3 jours ago | 0

| accepted

Answered
Plotting the given Trigonometric functions
You can use fimplicit() fun = @(x, y) y.*sin(2*x) - x.*cos(2*y); fimplicit(fun, [-10 10 -10 10])

3 jours ago | 0

| accepted

Answered
solution of a system non linear equations
If your system of equations has multiple solutions, fsolve() can only give you a single solution based on the initial point x0. ...

3 jours ago | 1

Answered
how do i substract the first value from the last one on an array taking out zero values?
If all the non-zero values are in increasing order, the try this M(M~=0) = M(M~=0) - min(M(M~=0)); Result >> M = [ 0 ...

3 jours ago | 0

Answered
get the image from the NYu depth dataset
The screenshow shows that the dataset loads images in a 4D array. You need to specify which image you want to see. For example ...

3 jours ago | 0

Answered
Undefined function or variable error
This usually means that MATLAB is not able to see the file get_kmers.m. MATLAB can only see a file if it is on its search path. ...

3 jours ago | 0

| accepted

Answered
Create delimited random vertices
You can sort the randomly generated values x = sort(randi([1 49], 5, 1)); y = sort(randi([1 49], 5, 1));

3 jours ago | 0

| accepted

Answered
How can I concatenate 163 matrices into a single matrix with a loop?
The first problem here is to name your variable like G1, G2, ..., G163. It is known to be a bad coding practice: https://www.mat...

3 jours ago | 1

| accepted

Answered
Write text below the photo
You can use xlabel to write something below the axes. xlabel('PSNR') Otherwise, you can also use text(), but this option is a ...

3 jours ago | 0

| accepted

Answered
how to use "fullfile" with exportgrahics
exportgraphics(gcf, fullfile(directory, fileName)', 'eps', 'Resolution',3000) %...

4 jours ago | 0

| accepted

Answered
How i extract the components of a vector/matrix output ?
Yes, that is the syntax. a(1) and a(2) a=polyfit(x,y,1); first_element = a(1); second_element = a(2); Read about indexing he...

4 jours ago | 0

| accepted

Answered
Possibly a bug in the ASSUME function (Symbolic Math Toolbox)
This is documented in the Tips section of assume() function: https://www.mathworks.com/help/releases/R2020b/symbolic/assume.html...

4 jours ago | 1

| accepted

Answered
Check and read different types of file types.
I am not sure about .ods, but MATLAB's readmatrix() is capable of importing .csv and .xls file. You don't need to tell MATLAB th...

4 jours ago | 0

| accepted

Answered
readmatrix "not enough input arguments"
You have defined a function name replace() placed on path C:\...\Thesis\emi-matlab-master\EMI_Calibration\replace.m which is s...

4 jours ago | 0

| accepted

Answered
Save figure handle globally in Simulink
That is not the current way to update handles from Simulink. I am not sure if it is even possible. Even if it is possible, it wi...

4 jours ago | 0

| accepted

Answered
Remove consecutive duplicates from matrix
Try this A=[ 1, 0, 3 2, 1, 3 2, 1, 3 2, 2, 3 1, 0, 3]; idx = find(~any(diff(A), 2))+1; A(idx, :) = [];

4 jours ago | 0

| accepted

Answered
Converting a human-readable txt file to machine-readable
Following loads the values again as numeric form str = fileread('HourlyBirkenesOzone.txt'); values = regexp(str, '(\d+\.\d+)',...

4 jours ago | 0

Load more