Answered
How to add two different vectors?
x = 0:1:10000; y = 2*x; z = linspace(0.1,1,length(x)); % make z same size as x, so use linspace x_n = x + z; y_n = 2*...

4 years ago | 0

Answered
What is wrong in my coding?
clc; clear all ; %%Q1a clear;clc; % Get the span of the beam along with positions of supports l = input('Enter the span ...

4 years ago | 0

Answered
How to concatenate selected data of two .mat files
Let A, B be your tables. C = A ; C.last = B.(10) ; % instead of last you give your required name

4 years ago | 0

| accepted

Answered
Coin toss simulation test
n = 1000 ; % number of tosses H = 0 ; % initialize Head count T = 0 ; % initialize Tails count % loop of toss for i ...

4 years ago | 1

| accepted

Answered
data of corresponding column
idx = columnA > 600 ; iwant = sum(columnB(idx)) ;

4 years ago | 0

Answered
How to sort and save the sorted table in app designer?
idx = randperm(10)' ; x = rand(10,1) ; T = table(idx,x) [val,idx] = sort(T.(1)) ; T = T(idx,:)

4 years ago | 0

Answered
Animation using multiple frames/figures in for loop
frame = 20; % Load density data n = load([Dir '/ne' num2str(frame) '.txt']); %this is my total denisty % Load X and Y data ...

4 years ago | 0

| accepted

Answered
Calculate the velocity for each time increment using displacement and time using a for loop?
velocity = gradient(displacement)./gradient(time)

4 years ago | 1

Answered
replace values in a matrix by their histogram bin numbers
[N,E,bins] = histcounts(A) ;

4 years ago | 0

| accepted

Answered
Where does matrix B fits best in Matrix A
A = 5*ones(8) ; A(4:6,4:6) = [3 4 2; 1 1 1; 2 3 3] ; B = ones(3) ; [m,n] = size(A) ; count = 0 ; v = zeros(3,3,[]) ; R...

4 years ago | 0

Answered
graph with 2 axes
https://in.mathworks.com/help/matlab/creating_plots/graph-with-multiple-x-axes-and-y-axes.html

4 years ago | 0

Answered
Heat plot in Matlab
doc heatmap https://in.mathworks.com/help/matlab/ref/heatmap.html

4 years ago | 0

| accepted

Answered
How does I extract data from netcdf on given lat lon?
You have multiple ways to do it. Load all the data into work space using ncread. And use slice. Read about slice function. F...

4 years ago | 0

Answered
Y data on the bar plot
n = 5 ; x = (1:n) ; y = randi(n,n,1) ; bar(x,y) hold on text(x,y+0.1,num2str(y)) ylim([0 6])

4 years ago | 1

Answered
Creating a transparent closed 3D surface plot from (x,y,z) scatter data points
d1=load('Scatter_data_x_y_z.txt'); shp = alphaShape(d1) ; plot(shp)

4 years ago | 0

Answered
Histogram fraction of total observations and fraction per unit width
You can get the wanted information from histogram. Example: x = randn(1,100) ; % random data for demo h = histogram(x) % ...

4 years ago | 2

Answered
Index in position 2 exceeds array bounds. Index must not exceed 27.
Error is clear and simple. You are trying to extract more number of elements than present in the array. A = rand(1,27) ; A(1)...

4 years ago | 0

Answered
Fix NaN error when n>300
If you have symbolic toolbox use vpa. REad about it. n=701; numerator=vpa(1); for i=n:-2:2 numerator=numerator*i; en...

4 years ago | 0

Answered
Elementwise indexing of a vector by a multidimentional array
n = 10 ; A = randi(n,2,2,10) ; B = rand(1,n) ; iwant = B(A)

4 years ago | 0

Answered
For loop overriding pervious data
If all the files have same dimensions, better save them into a matrix and then write into a file. filenames={'file1.mat,file2....

4 years ago | 1

Answered
For loop overriding pervious data
filenames={'file1.mat,file2.mat,file3.mat'} for i = 1:nume1(filenames) load(filenames{i}) THC1= THC_sim_cum ; [f...

4 years ago | 1

Answered
add new row to table with missing values
V.name = "Ann"; V.city = "Berlin"; V.age = 24; V.height = 172; T1 = struct2table(V); V2.name = "Luka"; V2.city = "Toky...

4 years ago | 0

Answered
I have an array of 6,76,000 as txt file, how can I convert that into 52x13x1000.
iwant = reshape(a,1000,13,52);

4 years ago | 1

Answered
How to obtain the value of the matrix X in equation AXA' = B?
For the give dimensions and given equation it cannot be solved. But for given dimensions the following equation can be solved. ...

4 years ago | 1

| accepted

Answered
Arguments of Reshape function with example
A = [1 2; 3 4; 5 6] ; % this is a 3*2 matrix reshape(A, [1,6]) reshape(A, [1 6]) % Both the above commands are same....

4 years ago | 0

| accepted

Answered
Rdata converting to mat file
R is an opensource code. You can download for free. Just download R, read the .rdata using load() and save the output using wr...

4 years ago | 1

Answered
How do I use the find function to track every last point that is black, so as to create a matrix of that border between white a black image. See Below
I = imread(myimage) ; I1 = imbinarize(rgb2gray(I)) ; [y,x] = find(I1) ; idx = boundary(I1) ; plot(x(idx),y(idx)) You can a...

4 years ago | 0

Answered
Concatenate elements of cell arrays vertically
A = {[8 9 0 0 1 0 1 0; 5 3 0 0 1 1 1 1]; [2 4 0 0 0 0 1 0; 3 9 0 1 0 0 0 1]; [6 2 1 1 1 0 1 1; 9 7 1 1 0 0 0 0]}; iwa...

4 years ago | 0

| accepted

Answered
Choosing a random number from a linearly spaced vector
xx= linspace(1,2,9) %a vector of linearly spaced values yy = xx(randi(9,1))

4 years ago | 0

| accepted

Answered
Trying to find an x value from a certain y value on my graph
idx = knnsearch(T_2,455) ; t(idx) If there is one-to-one mapping between (t,T_2) iwant = interp1(T_2,t,455)

4 years ago | 0

Load more