Answered
Error in a function
I suspect, you tried running the function using f5 button or run button from the editor. It is not the way to call the function....

6 years ago | 0

Answered
Finding every unique sequence given a matrix?
Read about nchoosek.

6 years ago | 0

Answered
to highlight median value on the plot.
You can get the corresponding points and use plot to draw a line. To show up the text, you can use the function text.

6 years ago | 0

Answered
Drawing a Cirlce on an Image using viscircles()
You can draw circle using the below code if center C and radius R of the circle are known. C = rand(1,2) ; % center of cri...

6 years ago | 0

Answered
How to read and plot this data
data = importdata("1_ 1_ 1.txt") ; plot(data)

6 years ago | 0

| accepted

Answered
How can I make this simple image on matlab?
m = 50 ; A = zeros(m) ; N = 10 ; for i = N:N:m n = m-i ; t = ones(1,n) ; A = A+diag(t,-i) ; end for i = N:...

6 years ago | 0

Answered
How to scale the columns of a large square matrix?
Let A be your m*n, and b be 1*n vector. iwant = A.*b ;

6 years ago | 0

| accepted

Answered
Can I change this?
k = num2str(array_X) ; % convert to string k(k ==' ') = [] ; % remove spaces There will be more other elegant ways.

6 years ago | 0

| accepted

Answered
can you help me to know whats wrong ??
This will work: clear all clc a= rand(1,3) ; % a random vector b= rand(1,3) ; % a random vector c= rand(1,3) ; % a ran...

6 years ago | 0

Answered
Printing a character n times
s = repelem('.',1,10) ; fprintf('%s\n',s)

6 years ago | 2

| accepted

Answered
How can I create a for cicle for the command 'readmatrix'?
txtFiles = dir('*.txt') ; N = length(txtFiles) ; iwant = cell(N,1) ; for i = 1:N thisFile = txtFiles(i).name ; ...

6 years ago | 0

Answered
How to delete values less than a given limit?
If K is your 1*10 vector. V(V<2.5) = [] ; % this removes all elements less then 2.5 V(V<2.5) = NaN ; % This will replace all...

6 years ago | 0

| accepted

Answered
how to divide a data set into training and testing but NOT randomly?
If data is your data array. N = size(data,1) ; % Assuming your data to be row major Ntrain = round(0.75*N) ; % get the i...

6 years ago | 1

Answered
How do I find the maximum value of every 7 days
d = (1:36)' ; % let this be number of days z = rand(size(d)) ; % let this be your water level % make d divisble by 7 fo...

6 years ago | 0

| accepted

Answered
more lines on plot
T = [0.75 1. 1.25 ] for i = 1:length(T) t = T(i) p(1)=1.01*10^5; for i=1:9; p(i+1)=p(i)+100; ...

6 years ago | 0

Answered
Replace numbers in a matrix depending on if statement
A(A<=5) = 0

6 years ago | 1

| accepted

Answered
I want to plot a 3d image of the set of values attached herewith. i am also enclosing the possible image that will be the output of the desired Matlab code.
data = xlsread('Book1.xlsx') ; x = data(:,1) ; y = data(:,2) ; z = data(:,3) ; nx = length(unique(x)) ; ny = length(un...

6 years ago | 0

| accepted

Answered
How to animate multiple lines at the same time
clear all % Initial Values m = 1.6e-27;%(Kg) m1 = 1.04e-25; m2 = 1.04e-26; d = 0.1; %cm q = 1.6e-19; %(C) v = 2e5; %(m/s)...

6 years ago | 0

| accepted

Answered
How can I detect the line in a binary image?
I = imread('image.png') ; I1 = rgb2gray(I) ; %% Remove the hwite background around the image I1(1:5,:) = [] ; I1(:,1:5) = ...

6 years ago | 0

| accepted

Answered
Help with H5 Looping
H5files = dir('*.H5'); % give the extension if not it is H5 N = length(H5files) ; for i = 1:N thisFile = H5files(i).n...

6 years ago | 0

Answered
How to calculate the angle between two lines from the same origin?
O = [0. 0.] ; % origin % Two points A = rand(1,2) ; B = rand(1,2) ; u = O-A ; v = O-B ; CosTheta = (dot(u,v) / (n...

6 years ago | 2

| accepted

Answered
pol2cart in loop and pre-allocating
You need not preallocate (x,y,z) when you use the function.....If you want to run it thrice, you can do the following. X = cel...

6 years ago | 0

| accepted

Answered
Convert txt file with 5 columns to plot a graph
data = importdata("OLED.DFT_Ey_Convertido.txt") ; x = data(:,1) ; y = data(:,2) ; nx = length(unique(x)) ; ny = length(u...

6 years ago | 1

| accepted

Answered
Contour plot of concave shape from 3 vectors coordinates
To make the plot look neater, you have to increase the number of discretizations. m = 100 ; n = 100 ; % can be changed xv1 =...

6 years ago | 0

| accepted

Answered
Matrix Dimensions Solution Needed
Read about the function size. If A is your matrix, size give you the dimensions. [m,n] = size(A) ; % m -rows, n - columns [...

6 years ago | 1

| accepted

Answered
Unable to perform assignment because the size of the left side is 1-by-100 and the size of the right side is 2-by-100.
k=100; x = 1:k ; y = 1:k ; F = f1(x,y) ; plot(1:k,F, 'r') Taking your function into consideration. k=100; z1 = @(x,y) ...

6 years ago | 0

Answered
Create matrix with iteration
You need not to use iteration. Read about diag, zeros and ones.

6 years ago | 0

Answered
segmentation of a signal
fs=2048; frame_duration=0.3; frame_samples_length=(frame_duration*fs); n= length(prblm); number_of_frames=floor(n/frame_samp...

6 years ago | 0

Answered
need richardson extrapolation pseudocode
https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/12Differentiation/richardson/matlab.html#:~:text=Matlab%20may%20be%20used%2...

6 years ago | 0

Load more