Answered
How do I print the final y values as well as y value at specific point
Read about interp1 to get the value of yi at given xi. If (x,y) is your data and you want value of y at given xi use: yi = ...

6 years ago | 0

Answered
How to use 2D logical mask on an image without for loop?
B = zeros(512,512,3) ; for i = 1:3 T1 = B(:,:,1) ; T2 = A(:,:,i) ; T1(idx) = T2(idx) ; B(:,:,i) = T1 ; ...

6 years ago | 0

Answered
How do I convert the binary valued column to decimal?
Load data from csv files using csvread. Use the function bin2dec to convert binary to decimal.

6 years ago | 0

Answered
How to find numbers from one matrix in another one?
[idx,ia] = ismember(A(1,:),B) ; A(2,idx) = 1 ;

6 years ago | 0

Answered
Grid data interpolation to find value in scattered points
Read about interp2.

6 years ago | 0

| accepted

Answered
How can I extract matrix without NaN values
There should be more elegant method wituhut using loops. clc; clear all ; A=[1 3 0 3 5; 2 3 4 1 0; 0 1 3 0 1; 2 4 5 4 4; 5 5 ...

6 years ago | 1

| accepted

Answered
create a calculator using arithmetic operators
prompt = 'Enter sign:' ; a=input(prompt,'s'); c=2; d=3; h=6; if strcmp(a,'+') e=c+d; e else e=c-d; e...

6 years ago | 0

| accepted

Answered
HOW extract a particular value from graph on Y-axis based on defined X-axis values?
Read about interp1.

6 years ago | 2

| accepted

Answered
convert images to video
imgFile = dir('*.png') ; N = length(imgFiles) ; % create the video writer with 1 fps writerObj = VideoWriter('myVideo.avi')...

6 years ago | 2

Answered
How create a raster (or DEM) from 3D points?
It depends how your data is scattered or gridded. Check the below two ways to plot your data. %%structured xi = unique(x) ; ...

6 years ago | 0

Answered
polyxpoly to find intersection
You may consider this https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function...

6 years ago | 0

| accepted

Answered
I cant solve this equation with iteration help me
syms Ts eqn = 12*(Ts-293)+0.8567*10^-8*Ts^4-800==0 ; s = solve(eqn,Ts) ; r = double(s)

6 years ago | 0

Answered
How to create a vector of single numbers
Are you looking for B = single(1:2:550)

6 years ago | 0

| accepted

Answered
i have 'n' separate excel files and each file has(m*1 data points ) , how to merge them into a single worksheet to obtain (n *m) data points??
xlFiles = dir('*xlsx') ; N = lenght(XlFiles) ; iwant = zeros(m,N) ; %m is your data size in file for i = 1:N thisFil...

6 years ago | 0

Answered
what does this symbols mean
: stand for all.....if comes in row place means all rows, if comes in column means all columns. ' stands for transpose. . wo...

6 years ago | 0

| accepted

Answered
How to deal with (i-1)th iteration
You need to start iteration with 2 ...or take iteration from 1 to n-1.

6 years ago | 0

| accepted

Answered
Taking the norm of every 1x3 vector inside a 60x3 data
If A is your 60*3 matrix.. iwant = sqrt(A(:,1).^2+A(:,2).^2+A(:,3).^2) ;

6 years ago | 0

Answered
Deleting Row and Column
If A is your matrix, you can remove last two rows and columns using: [m,n] = size(A) ; A(m-1:m,:) = [] ; % removes last tw...

6 years ago | 0

Answered
Dijkstra Grid Algorithm Code
https://in.mathworks.com/matlabcentral/fileexchange/12850-dijkstra-s-shortest-path-algorithm https://in.mathworks.com/matlabc...

6 years ago | 0

Answered
Plotting damped sine travelling wave equation in Matlab
You index t, is taking zero for the first time. Indices cannot be negative and zero in MATLAB. You need not to use loop, you can...

6 years ago | 0

| accepted

Answered
plotting 3 functions in the same graph
subplot(311) plot(x,y1) subplot(312) plot(x,y2) subplot(313) plot(x,y3)

6 years ago | 0

Answered
How to use array as loop?
y = 0:0.01:1 ; for i = y i end for i = 1:length(y) y(i) end

6 years ago | 0

| accepted

Answered
How to generate a random matrix with a constraint or step range ?
Read about randsample, randperms. C1 = 0:0.1:1 ; C2 = 0:1:10 ; C3 = 2:0.5:8 ; C4 = 0:-1:-10 ; N = 5 ; M = 4 ; C ...

6 years ago | 0

| accepted

Answered
How do I ensure an input as a number and not a letter/set of letters?
YOu can use isstring. https://in.mathworks.com/help/matlab/ref/isstring.html

6 years ago | 0

Answered
Sum question in Matlab
v1 = [1 2] ; v2 = [3 4] ; % MEthod 1 v = [v1 v2] ; iwant = sum(v) ; % method 2 v = v1+v2 ; iwant = sum(v) ;

6 years ago | 0

Answered
for loop and indexing a matrix help
A = rand(5) ; idx = A>0.7 ; % indices greater than 0.7 find(idx) A(idx) idx = A<0.5 ; % indices less tha...

6 years ago | 0

Answered
Excluding NaNs in resize
You can fill the NaN's using fillmissing. And then use resize the way you want. You can use interp2 to get them to the same si...

6 years ago | 0

Answered
caculate euclidean distance between columm in matrix
Let A be yout matrix... C1 = A(:,1) ; C2 = A(:,end) ; dC1 = diff(C1) ; dC2 =diff(C2) ; d = sqrt(dC1.^2+dC2.^2) ;

6 years ago | 0

| accepted

Answered
Draw a five star
Read about plot. A = [ 6.5, 0 9, 5, 14, 5.5, 10.5, 9, 12, 14, 6.5, 11.5, 2, 1...

6 years ago | 0

| accepted

Answered
How to have use int() in a for loop?
syms x B=(pi-asin(1/2)) al=asin(1/2):0.001:B; V=200*sin(x); i=1; for i=1:length(al) I = double(int(V,x,al(i),B)) ; ...

6 years ago | 0

Load more