Answered
f(x,y)<=0
It depends on what your function f is. Your function f will show some relation between x and y. Also you should define range of ...

6 years ago | 1

Answered
Problems of convert decimal number to a string
iwant = sprintf("0.12f 0.12f 0.12f",num) ; Try with sprintf. You can split each number into a cell using num2cell, and use ce...

6 years ago | 0

Answered
Put every 3 data points in matrix A into a separate row in matrix B.
A = 1:9 ; iwant = reshape(A,3,3)' ;

6 years ago | 0

| accepted

Answered
How can i make my results occupy less space on my plot?
n = 101; % Number of grids dy = 1.0 / (n-1); Re = 100; % Reynolds Number we define phi_new = zeros(1,n); % St...

6 years ago | 1

| accepted

Answered
Easy Substitution (variable)
delta = subs(delta,v)

6 years ago | 0

| accepted

Answered
Montage Function Problems in MATLAB
Try montage({im11, im22, im33, im44}) ; If all your images are 3D, try montage(cat(3,img1,img2,img3,img4)) ;

6 years ago | 0

Answered
How to Run a Code for all files in a folder
You input the filename to the function transformdata and save the output into cells. files = dir('*.csv') ; N = length(files...

6 years ago | 0

| accepted

Answered
if greater than in for loop
for k = 1:length(seven) if seven(k) > 100 seven(k) = seven(k) - 25 ; end end

6 years ago | 0

| accepted

Answered
how to get coordinates of a marker
You can plot your required circle given center and radius using the below method. C = [346 278] ; % Center of the circle R ...

6 years ago | 0

| accepted

Answered
How can I color the pixels of my image depending of it's value in an equation?
Let I be your image pixle matrix with the values Prob repalced using the shown formula. % To repalce values less than Prob id...

6 years ago | 0

Answered
Insert missing values in specified positions and use for loop
This problem is dicussed multiple times....you can checki there in this useful link: https://in.mathworks.com/matlabcentral/ans...

6 years ago | 0

| accepted

Answered
How do I colour a band between 2 sets of data of different length
x=randn(1,200) ; t=1:200 ; y=4+randn(1,180); t1=1:180 ; % Append NaN's in y1 to extend it to 1:200. n = length(t)-length(...

6 years ago | 0

Answered
Contour on a contourf plot
contourf gives you a colored plot. It fills the contour lines region with colors. To get whay you want use: c = contour(Xi,Yi,Z...

6 years ago | 0

| accepted

Answered
Extracting data from Text file
fid = fopen("Ocb_pl.txt") ; S = textscan(fid,"%d %f %f %f %f\n",'HeaderLines',135) ; fclose(fid) ; S{1}

6 years ago | 0

Answered
How to select the first appearance of the minimum value?
d = abs(A-b) ; [d,idx] = sort(d) ; % sort them in increasing order iwant = min(A(idx(1:2))) You can try knnsearch...read ab...

6 years ago | 1

| accepted

Answered
How to calculate average of three columns from textfile?
txtFiles = dir('*.txt') ; % get all files N = length(txtFiles) ; % total number of files M = zeros(N,3) ; % mean int...

6 years ago | 0

Answered
Shrink image without using imresize
Let I be your image of size 1200x1100. [m,n,p] = size(I) ; [X,Y] = meshgrid(1:m,1:n) ; xi = linspace(1,m,650) ; yi = lin...

6 years ago | 0

| accepted

Answered
Problem in contour plot using ''for '' loop.
May be you are looking for contour(T,G,M)

6 years ago | 0

Answered
How to ensure that the value in my mxn matrix does not exceed certain value?
for i = 1:2 for j = 1:2 A(i,j) = input("enter value:") ; while A(i,j) > 2 A(i,j) = input("enter value, less...

6 years ago | 0

Answered
How can i extract specific points that meet a condition from given data?
I will use histogram, and get the indices. clc; clear all ; data = importdata("xycoords.txt") ; x = data(:,1) ; y = dat...

6 years ago | 0

| accepted

Answered
Counting elements in cell array
If C is your cell array of strings. n = nnz(strcmp(C,'cat'));

6 years ago | 0

| accepted

Answered
How can the center be determined by the Kmeans method?
[idx,C,D] = kmeans(grayImge(:),numberOfclasses) ; C is your cneter. Read about kmeans. You can your center along with the fu...

6 years ago | 0

| accepted

Answered
Calculating EigenVectors from Mode Shapes
Refer this: https://in.mathworks.com/matlabcentral/fileexchange/30970-natural-frequencies-buckling-loads-of-columns-using-finit...

6 years ago | 0

Answered
plotting graph through while loop
x = zeros([],1) ; y = zeros([],1) ; n_device =10; count = 0 ; while(n_device<=50) count = count+1 ; probability=b...

6 years ago | 0

Answered
Quiver Plot only shows vertical vectors
[x,y] = meshgrid(-10:1:10,-10:1:10); dx = 1; dy = y.*(3-(x.*y)); % Element by element multiplication r = ( dx.^2 + dy.^2 )....

6 years ago | 0

| accepted

Answered
How to compare the colums ( 2nd and 3rd) of 2 .csv files based on a condition
clc; clear all file1 = fopen('file1.csv'); file2 = fopen('file2.csv'); data1 = textscan(file1, "%s,%f,%f,%d\n", "HeaderLine...

6 years ago | 0

Answered
What does the varargin function do and what does varargin{:} mean?
varargin stands for variable number of arguments. You can input any number of arguments to the function. And these inputs are re...

6 years ago | 0

Answered
Heat (or color coded Map) in Matlab
Arrange all your mean values in an array. M = mean(S(:).BoundingBox) ; % get all means in an array rgb = vals2colormap(M,'je...

6 years ago | 0

Answered
3D grid from a large 3D matrix
load Q3D.mat ; x = linspace(-200,+200,200) ; y = linspace(-200,+200,200) ; z = linspace(-600,+600,600) ; [X,Y,Z] = meshg...

6 years ago | 1

| accepted

Answered
Assigning multiple values to a matrix at locations specified by an array of indices?
Read about sub2ind. This should be used for your case. val = [98 99 100] ; idx = sub2ind(size(my_mat),x,y) ; my_mat(idx)...

6 years ago | 2

| accepted

Load more