Answered
# 1:end
idx = [2 5 7 8 9] ; g = zeros(3) ; g(idx) = 1 ;

6 years ago | 0

Answered
How to read mutlple .h5 files
hfiles = dir('*.h5') ; N = length(hfiles) ; % loop for each file for i = 1:N thisfile = hfiles(i).name ; % read...

6 years ago | 1

| accepted

Answered
plotting x,y,z vertices as mesh
clc;clear;close all; test = xlsread('data.xls'); x=test(:,2); y=test(:,3); z=test(:,4); tri = delaunay(x,y); ...

6 years ago | 2

Answered
How do I graph game scores over time?
You need to save the result into a vector and plot at the end. This is included in the below code. scoreA=0; %score for player...

6 years ago | 1

| accepted

Answered
How to divide the curve into two sections and then fit straight line for both sections separately and get intersection of the lines?
Load the excel file into MATLAB using xlsread. Divide the data into sections using data1 = data(1:1000,:) ; data2 = data(1001:...

6 years ago | 0

Answered
use of comma & semi colon
That means....in the matrix A in the first row (1) the columns one to 9 are filled with [ 30, 25, 16, 32, 15, 37, 18, ...

6 years ago | 1

Answered
Combine two column vectors when importing data from .csv into one
Let A be integer and B be decimal iwant = A+B/10 ;

6 years ago | 0

Answered
How to create a specific Matrix
c = [1 1 2 2 3 3]' ; iwant = repmat(l',1,4) ;

6 years ago | 0

Answered
Overlaying contourf plot on a geomap with coordinates
[m,n] = size(C) ; lat = linspace(lxs,lxe,m) ; lon = linspace(lys,lye,n) hold on contour(lat,lon,C)

6 years ago | 0

| accepted

Answered
How to remove grid lines from a plot
Use shading interp after plotting the mesh.

6 years ago | 0

| accepted

Answered
Store calculated answer for each Frame in a vector
If you have an array and you want to store the max and min value in a vector use: themax = zeros(10,1) ; themin = zeros(10,...

6 years ago | 0

Answered
Change the structure of multiple .txt files and store them as .mat files
txtfiles = dir('*.txt') ; % you ar eint he folder of text files N = lenght(txtfiles) ; % Total number of files for i = 1...

6 years ago | 0

| accepted

Answered
Plot several lines on the same plot for the same unique category
Let T be your data of size m*3. C = T(:,1) ; % category F = T(:,2) ; % Frequency M = T(:,3) ; % Modulus figur...

6 years ago | 0

| accepted

Answered
how to extract the equidistance points from a graph at a particular interval
Read about interp1.

6 years ago | 0

| accepted

Answered
How differentiate without using any built-in function
YOu calculate your array by substituing the required values...and use dy = diff(ye)/dt ; % where dt is step size

6 years ago | 0

Answered
Need help with string counting
You have made your code very lengthy......you should follow like this. S = {'A','B',.....'Z'} ; % write all the letters dyd...

6 years ago | 1

Answered
How to get the coordinates from a certain image.
You can use the inequalities and remove them from the points. idx = y<200 ; x(idx) = [] ; y(idx) = [] ; Also you can use ...

6 years ago | 0

| accepted

Answered
Why am I getting this matlab error?
Your neighbors variable is an array of points which has fractional numbers/ negative/ and zeros. You cannot use such numbers as ...

6 years ago | 0

Answered
Get the Centroid of a specific object in an image
I = imread("image.png") ; [y,x] = find(I==0) ; iwant = [mean(x) mean(y)] ; % check imshow(I) hold on plot(iwant(1),iw...

6 years ago | 0

| accepted

Answered
How to place a random complex number in a random position in a vector of zeros with iteration?
You can select the random positon/ index using randsample A = zeros(1,21) ; idx = randsample(length(A),1) ; A(idx) = ran...

6 years ago | 1

Answered
Need help getting right orientation
You should follow something like this: a = 5 ; b = 4 ; T1 = 80 ; m = 100 ; n = 100 ; x = linspace(0,a,m) ; y = lin...

6 years ago | 1

Answered
Convert R code to Matlab Code
lam=0.01 ; d=0.8 ; reps=21 ; rvec=linspace(0,10,reps) ; % vector of R0 values inf=zeros(1,length(rvec)) ;; % empty vector ...

6 years ago | 0

| accepted

Answered
How to pad zeros in an image
Let I be your 64*64 image. iwant = [I zeros(64,1)] ;

6 years ago | 0

| accepted

Answered
how to findpeaks at signal crossing threshold
Read about logical indexing. If I have a singal like below: x = rand(100,1) ; threshold = 0.8 ; idx = x > threshold ; ...

6 years ago | 0

Answered
Gass Elimination no pivot
function x = GaussElim(A, b) % Solve linear system Ax = b % using Gaussian elimination without pivoting % A is an n by n matr...

6 years ago | 3

Answered
How to put my value on a graphic
temps = 0 ; incrementTemps = 0.001; positionAngulaireRotor = 0; vitesseAngulaireRotor = 0; i=1; Te...

6 years ago | 0

| accepted

Answered
Renames a lot of files in directory
f = dir( fullfile( projectdir, '**', '*.mat') ); for kk = 1:numel(f) fileFrom = f(kk).name; fileTo = ['Flight','1000%d.ma...

6 years ago | 0

| accepted

Answered
Swapping elements from one matrix to another.
Read about logical indexing. A(A<0) = B(A<0) ;

6 years ago | 0

| accepted

Answered
How to find the infelction points from the data
https://in.mathworks.com/matlabcentral/answers/383721-how-to-find-inflection-point-please-help

7 years ago | 0

Load more