Community Profile

# KSSV

##### Last seen: Today
7,427 total contributions since 2011

Professional Interests: Mathematical Computing

View details...

Contributions in
View by

How to import data from .txt file?
data = importdata(mytextfile) ;

4 hours ago | 0

ASSIGN COMPLEX NUMBERS(X+jY) RANDOM INTEGERS BETWEEN 1 and 3
N = 5 ; C = zeros(N,1) ; for i = 1:N C(i) = randperm(3,1)+1i*randperm(3,1) ; end

4 hours ago | 0

Why subplots doesn't work?
subplot(2,2,1) plot(a) subplot(2,2,2) plot(b) subplot(2,2,3) plot(a2) subplot(2,2,4) plot(b2) Note that figure will open...

5 hours ago | 0

How to load multiple .mat files into two different groups
USe this file exchange: https://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort First nine will ...

6 hours ago | 0

Error with surf function
[m,n] = size(data) ; x = 1:n ; y = 1:m ; surf(x,y,data) Also you can straight away use: surf(data) ;

8 hours ago | 1

| accepted

Plotting after a for loop
x = -5:5 ; y = zeros(size(x)) ; y(x>=0.5) = 0.5 ; plot(x,y)

8 hours ago | 0

how to put only one element randomly in row of matrix
A = zeros(4,3) ; [m,n] = size(A) ; for i = 1:m idx = randperm(n,1) ; A(i,idx) = 1 ; end

10 hours ago | 0

| accepted

How can you clear the content of a workspace in the MATLAB environnement
There are multiple errors possible in MATLAB. Refer here: https://en.wikibooks.org/wiki/MATLAB_Programming/Error_Messages

13 hours ago | 0

I want to divide color image in small tiles and then need to count number of color pixels in each tile.
Refer this to split the matrix/ image into blocks https://www.mathworks.com/matlabcentral/answers/362262-i-have-a-32-32-matrix...

15 hours ago | 0

hi i want to save images
for i = 1:44 h=figure ; plot(rand(1,10)) ; saveas(h,sprintf('FIG%d.png',i)); % will create FIG1, FIG2,... end

1 day ago | 0

| accepted

How can I create a small cell 500*500 pixel in one satellite image?

1 day ago | 0

How to use matlab to calculate this sum?
With loop N = 1000 ; thesum = 0 ; for i = 1:N thesum = thesum +(1/i+1/((i+2)*(i+3))) ; end Without loop N = 1000 ; ...

1 day ago | 0

how to specify the particular column numbers of a matrix in for loop
for i = 1:1801 for j = 70:75

1 day ago | 0

| accepted

How do I call to function from other function?
You need to save both the function files in the same folder and yes call the other function in the required function. It is very...

2 days ago | 1

| accepted

How to set different marker for some different values?
fmt = {'*','o','^','.','+','x','s','p','h'}; % different markers x = 1:9 ; y = rand(size(x)) ; figure hold on for i = 1:...

2 days ago | 0

| accepted

Sum the values of one column based on another column in Table
Let T be your table. R = T.Range ; val = 862.33 ; count = nnz(abs(R-val)<=10^-5)

2 days ago | 0

Recover matrix Z from XZX', Z es symmetric and n-by-n, while X is k-by-n where n>>k
Does this match your criteria? k = 8 ; n = 5 ; % create dummy data X = rand(n,k) ; Z = rand(n) ; Z = Z+Z' ; % make ...

3 days ago | 0

How to find the power of a matrix?
A=A/10^5 ; A = A.^2 ;

3 days ago | 0

How to find convolution of three functions.
Read about conv2. s1 = conv2(conv2(f1,f2),f3) s2 = conv2(conv2(f2,f3),f1) s3 = conv2(conv2(f1,f3),f2) All the abve three a...

3 days ago | 0

| accepted

Error using sym/subsindex
Initialize the cell first. Q =cell(length(a),length(ttt)) ; % initialize USe this in the loop. Q{i,j} = %% your formul...

4 days ago | 0

How to cut area or some part of image ?

4 days ago | 0

How to avoid patch color being included in legend ?
clc; clear all; close all; x = linspace(-10,10,200); y = sin(4*x); y1 = sin(x); figure; hold on patch([2 5 5 2], [[1 1]...

4 days ago | 1

Change resolution of .xyz file in matlab

5 days ago | 0

Create stl. file with [F,V,N] data
USe this: https://www.mathworks.com/help/matlab/ref/stlwrite.html#d120e1182467

5 days ago | 0

Index exceeds the number of arrays
Try to clear the variables, before using your code. There is no error in your code. It should work. clc; clear all; A = 4; W...

5 days ago | 0

| accepted

Let A be your n*2 array. t = A(:,1) ; s = A(:,2) ; [C,ia,ib] = unique(t) ; N = length(C) ; iwant = zeros(N,1) ; for ...

5 days ago | 0

peak Value of a spike in graph at a particular time

5 days ago | 0

dynamic allocation of arrays
You can initiate it to a cell. resultPolygon = cell(720,1); for i = 1:720 newShaper = homogeneousTransformMatrix(phi(i))...

5 days ago | 0

| accepted

How can I save multiple matrix and index them?
txtFiles = dir("*.txt") ; N = length(txtFiles) ; themax = zeros(N,1) ; % loop for each file for i = 1:N data = import...

5 days ago | 0

| accepted

Crop out a section of the image in imshow, how?
Read about imcrop. Let I be your image. rect = [234 355 (1678-234) (764-355)] iwant = imcrop(I,rect) imshow(iwant)

5 days ago | 0

| accepted