Answered
Select area in picture and send information about r,g,b
If I is an image you canget: R = I(:,:,1) ; G = I(:,:,2) ; B = I(:,:,3) ; You can select your required area using imcrop, i...

6 years ago | 0

Answered
How can we define a function with variables which are in the for loop and function is also under for loop?
Read about anonymous function. EXample: f = @(x1,x2,x3) 2*x1.^3+3*x2.^2+x3 ; x1 = rand(10,1) ; x2 = rand(10,1) ; x3 = rand(1...

6 years ago | 0

Answered
Finding max of an element vector using recursion
You can first google it before posting a question here. It is old question and you will find many useful links: For example: ht...

6 years ago | 0

| accepted

Answered
Add new column at the end of matrix
A = rand(3) ; B = [1 2 3]' ; C = [A B]

6 years ago | 2

Answered
Why does my code output answers in log?
Remember:

6 years ago | 1

Answered
Finding peaks in signal
There are other alternatives, if you don;t want to use findpeaks. Few I got are. https://www.mathworks.com/matlabcentral/filee...

6 years ago | 0

Answered
How can I plot a python equivalent list of tuples in matlab?
P = [38.5 25.4 34.7 647 621 873] ; plot(P(1,:),P(2,:))

6 years ago | 0

Answered
3D Plot Troubles
R = 8.31; T = linspace(273, 473); V = linspace(0.5*10^(-3), 2*10^(-3), 100); n = 1:length(T); N = repmat(n,length(T),1) ; ...

6 years ago | 0

| accepted

Answered
node creation using for loop
This should help you: https://www.mathworks.com/matlabcentral/answers/412639-creating-surface-plot-from-a-matrix-with-3-column...

6 years ago | 0

Answered
How to calculate the angle between two sets of scatter plots?
o = [ 3.11009098091043 0.0161338808382554 -3.50871929189684 34.1536562864604 0.446152781388255 -3.5092277037868...

6 years ago | 0

Answered
How to read and import data with only specific values from a text file?
You can read the entire data and use inteprolation to get the values you want. data = importdat(MYFILE) ; time = data(:,1) ;...

6 years ago | 0

Answered
How do I change the arrangement of numbers?
str = '1193' ; idx = perms(1:4) ; iwant = str(idx) You can use str2double to get them into numbers.

6 years ago | 0

| accepted

Answered
Polynomial as input in a function.
LEt a, b be your max and min values x = linspace(a,b,1000) ; p = 2*x.^2+3*x+5 ; % polynomial plot(x,p)

6 years ago | 1

| accepted

Answered
How transform all ‘NaN’ string in double NaN for each rows
Let T be your table. T.C = str2double(T.C) ;

6 years ago | 0

Answered
How to find the length of a Parabola
x = linspace(-10,+10,10^3) ; y = 1/20*x.^2 -5 ; dx = diff(x) ; dy = diff(y) ; L = sum(sqrt(dx.^2+dy.^2) );

6 years ago | 0

| accepted

Answered
how do I calculate all values in for loop?
You need to save each value in aloop. function [Tc, P] = myfun1(Ppv_rated, x, G , Gref, Kt, Tref, Tamb) m = numel(x); n = n...

6 years ago | 1

Answered
Saving a figure to a specific location
fpath = 'C:\Users\jmoor\OneDrive\Documents\MATLAB\FigureExport'; filename = 'test' ; saveas(gca, fullfile(fname, filename), '...

6 years ago | 0

Answered
Split Number into digits adding up to it.
n = 4 ; [X,Y] = meshgrid(0:n,0:n) ; thesum = X+Y ; idx = thesum==n ; iwant = [X(idx) Y(idx)] n = 6 ; [X,Y] = meshg...

6 years ago | 1

Answered
Find the point of intersection and plot it
This function https://www.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections works like a charm for finding inte...

6 years ago | 0

Answered
creating polynomial to matix
Read about poly2sym https://www.mathworks.com/help/symbolic/poly2sym.html If this is not you are expecting..read about polyva...

6 years ago | 0

Answered
Shaping a vector in a 2 dimensional array changes the value of its element
Let A be your given m*3 data. x = A(:,1) ; y = A(:,2) ; z = A(:,3) ; xi = unique(x) ; yi = unique(y) ; [X,Y] = meshgrid(xi,y...

6 years ago | 0

| accepted

Answered
How to delete a value and the value next to it?
f = 'S 0 92 -707 1349 92 -708 1348 92 -708 1348 92 -709 1347 92 -709 1347 93 -710 1347 93 -711 1347 93 -711 1346 S -712 1346 94 ...

6 years ago | 0

Answered
How do use a vector as input to a function?
function A = boxArea(A,area) x1 = A(1) ; x2 = A(2) ; x3 = A(3) ; x4 = A(4) ; y1 = A(5) ; y2 = A(6) ; y3 = A(7) ; ...

6 years ago | 0

Answered
Meshing a geometry and find mesh face normal vectors
Refer this: https://www.mathworks.com/matlabcentral/fileexchange/6678-stlread

6 years ago | 0

Answered
how to plot 2D mesh using coordinates and connectivity matrix?
Use PlotMesh function from the link: https://www.mathworks.com/matlabcentral/fileexchange/31788-the-plane-stress-problem

6 years ago | 0

| accepted

Answered
time averaged of 5000 images
imgFile = dir("*.tif") ; N = length(imgFiles) ; iwant = zeros(m,n,N) ; % where [m,n] is size of each image. Assuming each ...

6 years ago | 0

Answered
How to extract acoustic samples containing high decibels
To know high values, use max. [val,idx] = max(f) ; val f(idx) y(idx) To get the values lying beyond certian given values,...

6 years ago | 0

Answered
Cut images with equal size and position
Yes i can be done....define your (x1,y1) and (x2,y2). Note that they should be positive integers. Let I be your image. iwant =...

6 years ago | 0

| accepted

Answered
Removing outliers from a table
If id is the row number which you want to delete: yourtable(yourtable.id, :) = [];

6 years ago | 0

Answered
How to compute f(x) = 100*((X1-1) + (X2-1) +(X3-1))/Z(Y-1)
Using anonymous functions: clc; clear all ; f = @(X1,X2,X3,Z,Y) 100*(((X1-1) + (X2-1) +(X3-1))/Z*(Y-1)) ; val = f(3,2,1,3,3...

6 years ago | 0

| accepted

Load more