Answered
merge the nodes at the two contacting interfaces
Read about knnsearch. This will give the closest point indices and distances also. Put a criteria by diatnce to merge the nodes....

7 years ago | 0

Answered
How to avoid cell2mat while reshaping cell arrays
C{1} = rand(55430,2350) ; C{2} = rand(55430,2200) ; C1 = num2cell([C{1}(:,1) C{2}(:,1)],2) ; C2 = num2cell([C{1}(:,2:end)...

7 years ago | 0

Answered
how to about Error using horzcat Dimensions of matrices being concatenated are not consistent.
YOu must know the size of matrices you are concatenating. If they are not compatible you will get error. Check the below example...

7 years ago | 0

Answered
Assign rank to matrix and compare it
Name = {'Fred';'Betty';'Bob';'George';'Jane'}; Age = [38;43;38;40;38]; Height = [71;69;64;67;64]; Weight = [176;163;131;185;1...

7 years ago | 0

| accepted

Answered
Write for loop for 24x1 struct
y = {fieldnames(:).folder }

7 years ago | 0

Answered
Generate random points on a hemisphere
https://in.mathworks.com/matlabcentral/answers/457965-how-to-generate-random-points-located-on-the-surface-of-a-hemisphere-with-...

7 years ago | 0

| accepted

Answered
how to store all your values from a loop into a vector
% h k radius A=[-7.3763 7.6512 7.8 3.5199 1.0563 5.6 5.2646 -4.8721 10.0...

7 years ago | 0

| accepted

Answered
3D plot of data
Option 1: USe scatter: [num,txt,raw] = xlsread('Data_3Dplot.xlsx') ; num = num(9:end,:) ; nodes = num(:,1) ; value = n...

7 years ago | 0

| accepted

Answered
How can I slow down the plotting speed?
Read about pause

7 years ago | 1

| accepted

Answered
Can anyone tell me what is wrong in this code?
coefs = pp.coefs ; breaks = pp.breaks ; peices = pp.pieces ; order = pp.order ; dim = pp.dim ;

7 years ago | 0

| accepted

Answered
How to print this graph?
https://in.mathworks.com/matlabcentral/answers/342492-how-to-write-a-program-to-draw-a-diamond-of-stars-in-matlab https://in....

7 years ago | 0

| accepted

Answered
What are the areas in Matlab for mechanical engineering?
As you are in first year of Engineering...you will have Mathematics and Applied Physics in your first year. You can try to code ...

7 years ago | 0

| accepted

Answered
Vectors must be the same length.
YOu need to check the loop part..... lamda=0.2; mu=1-lamda; P1=mu^2/(mu+lamda)^2; P2=2*lamda*mu/(mu+lamda)^2; P3=lamda^2/(m...

7 years ago | 0

Answered
Changing Indexing Order in matrix raws
a1 = [0 0 0 0 0 0 0 0 0 1 2 3 4 5] ; a2 = [12 11 14 5 1] ; a3 = zeros(size(a1)) ; a3(a2) = a1(a1~=0)

7 years ago | 1

| accepted

Answered
add to values in a varying size cell array
CA = {[-10 2],[6 6 8],[0 9 -10 8 -10]}; CB = {[17 2],[6 6 10],[9 3 4 9 7]}; for i = 1:length(CA) idx = CA{i}==-10 ; ...

7 years ago | 0

Answered
Plotting data from .csv file
data = csvread('mydatafile.csv',4); % Read the data t = data(:,1) ; x = data(:,2) ; y = data(:,3) ; z = data(:,4) ; plot...

7 years ago | 3

| accepted

Answered
Undefined function 'int' for input arguments of type 'double'.
Read int here: https://in.mathworks.com/help/symbolic/int.html What you are using int is to find the integral for the given s...

7 years ago | 0

Answered
simplifying the formula symbols
syms t1 t2 M=[cos(t1), sin(t2)]

7 years ago | 0

Answered
Joining a set of points inside a buffer to get a polygon.
X=[364.5333 232.1333 397.0667 157.5333 431 421.3333 306.9286 184.3846 357.7333 199.4118 168.6429 179.4737 408.1333 382.4706 150....

7 years ago | 0

Answered
Don't want my points on the boundary
s = 2; dx = 0.5 ; % can be changed to your desired offset ss = -s+dx:s-dx; [x,y] = meshgrid(ss); plot(x,y,'ko'); hold on...

7 years ago | 0

Answered
ERROR: Undefined function 'sum' for input arguments of type 'cell'. Kindly help me resolve the error.
Use p = cellfun(@sum,arrayfun(@(x) x*wdwd, 1:2*N, 'un', 0),'un',0) ; instead: p=sum(arrayfun(@(x) x*wdwd, 1:2*N, 'un', 0)); ...

7 years ago | 1

| accepted

Answered
calculate mean using while and iteration?
Why loop? YOu can use inbuilt in mean. Let a,b be your columns. idx = a>0.5 & a<1.5 ; mean(b(idx))

7 years ago | 0

Answered
How to find X and Y coordinates of a matrix?
A = [1 2 3 4 5 6 7 8 9]; [nx,ny] = size(A) ; x = linspace(0,25,ny) ; y = linspace(0,10,nx) ; [X,Y] = meshg...

7 years ago | 0

| accepted

Answered
Matrix indexing collecting accurate results
A1 = zeros(3,3,100) ; A2 = zeros(3,3,100) ; A = zeros(3,3,100) ; for i = 1:100; v2(1:3,i) = [cross(v1(1:3,i),(Sb(1:3,i)))/...

7 years ago | 0

| accepted

Answered
how to convert num to string ?
x = { [22] '22 .8 ' [30] '39 .6 ' [44] [48] '49 .6 ' '50 .8 '} ; idx = cellfun(@i...

7 years ago | 0

| accepted

Answered
Plot - Closing the gaps between different curves
Read about fillmissing, interp1.

7 years ago | 0

Answered
matrix question about array and absolute value
Read about input and sort functions.

7 years ago | 0

| accepted

Answered
Combining specific range of excel files into one excel file
files = dir('*.xlsx') ; N = length(files) ; data = cell(N,1) ; for i = 1:N data{i} = xlsread(files(i).name) ; end d...

7 years ago | 0

| accepted

Answered
How to return the maximum value of a vector without using the built in function max(x)?
K = rand(5) ; themax = -Inf; row = 0; column = 0; for i = 1:size(K, 1) for j = 1:size(K, 2) if K(i, j) > thema...

7 years ago | 0

Load more