Solved


Array Height (no usage of size)
Find the array height, the number of rows. Size may not be used.

3 years ago

Solved


Array Width (no usage of size)
Find the array width. Size may not be used.

3 years ago

Solved


Array size along k-th dimension
Given an n-dimensional array M, find the size of M along the k-th dimension (1 <= k <= n), without using size(), height() or wid...

3 years ago

Answered
Efficient and quick way to summation of large data points
(In addition to @Bruno Luong's answer) Define t and d outside the loop and vectorize the first loop - voltage = reshape(voltag...

3 years ago | 0

Answered
Sort the first column of an array in ascending order
Check out sortrows

3 years ago | 0

| accepted

Answered
3D Streamline Example
Change the view (which is done in the example code as well) - load wind; [startX,startY,startZ]=meshgrid(90,10:10:60,0:5:25);...

3 years ago | 0

| accepted

Answered
How to number a plot legend for the number of values a user inputs
Use compose %Random value for example n = 5; str = compose("G(s) #%d", 1:n) %use the generated string as legend legend(str)...

3 years ago | 0

Answered
Convert 3d cell array into a 3d Matrix
Assuming all cell elements are numeric scalars, use cell2mat %Example x = num2cell(rand(1,2,3)) y = cell2mat(x)

3 years ago | 1

Answered
Remove colorbar border but keep tick labels
The closest you can do is turn the outline of the colorbar off. The axis is integrated with ticks and tick labels. surf(peaks) ...

3 years ago | 1

| accepted

Answered
Convert a symbolic function in to optimization function
(Assuming you already have the symbolic toolbox) Use matlabFunction - syms x1 x2 %Original symbolic expression M1=10*sin(x1...

3 years ago | 0

| accepted

Answered
Why is the convolution for the same signals different?
"Why?" Because you have limited the x axis, so it only displays the curve in that limit, and why it looks different. "Is it ...

3 years ago | 1

| accepted

Answered
MATLAB start-up window size
Check out - https://in.mathworks.com/matlabcentral/answers/262316-code-to-change-matlab-window-size https://in.mathworks.com/...

3 years ago | 1

| accepted

Answered
How can I implement these for loops efficiently using covolution?
Simple multiplication would be good enough - xx = 1:length(x); kk = 1:length(x); xSinc(xx) = xSinc(xx) + x(kk)*sinc(xx-kk'...

3 years ago | 0

| accepted

Answered
Collect the coefficients of a symbolic expression for an Op Amp circuit function
syms A Ga Gb G1 G2 C2 V1 V2 s %Defining expression expr = V2 == A*((G1*G2*V1 + C2*G2*V2*s)/(C2^2*s^2+G1*G2 + C2*G1*s + 2*C2*...

3 years ago | 0

| accepted

Answered
How do I find indexes of three for-loops of maximum value of function with three indexes?
The MATLAB approach to generate the output would be - (Edit - corrected some typos) xx=0:1:5; yy=0:1:7; zz=-5:1:1; %Note...

3 years ago | 1

| accepted

Answered
Create a vector with the non-zero indices of a cell array
%Random data y = {[],[];[] repmat({rand},3,3); [] []; repmat({rand},4,3) []} %Find if all cells in a row are empty or not and ...

3 years ago | 0

| accepted

Answered
Please help me to plot theta_2 and theta_4 in a graph please. I try this code but the graph shows blank
When plotting a single point at a time, you will have to include a marker, to obtain the points on the figure. clear all % Cre...

3 years ago | 0

Answered
Problems in finding a set of global minima
Functions like fminbnd (and fzero, etc) work differently than what you are expecting them to work like. It would be better to u...

3 years ago | 1

| accepted

Answered
How to customize the way MATLAB combines an expression with a lot of symbols?
Use collect I assume you already have the Symbolic Math Toolbox

3 years ago | 1

| accepted

Answered
Making new matrix with specific rows
A = { 'ABC' 1.0000 5.5000 'ABC' 2.0000 1.2000 'DEF' 3.0000 6.4000 'ABC' 4.0000 3.700...

3 years ago | 0

| accepted

Answered
How to properly compare tensors?
Use logical indexing. function toint = toint(p, r, R, dRdt, mu) c = 29979245800; %cm/s gamma = 1/sqrt(2*(1 - (dRdt/c).^2));...

3 years ago | 0

| accepted

Answered
Symbolical differentiation of parametric function
The function you are using for Legendre polynomials only accepts numerical inputs. What you are looking for is legendreP, the ...

3 years ago | 0

| accepted

Answered
adding vector to matrix to create tensor
%Sample example y = rand(12,12); z = rand(12,1); %Change the dimensions of z from mxnx1 to nx1xm z0 = permute(z,[2 3 1])...

3 years ago | 0

| accepted

Answered
Circular vortex with spin vectors
% Parameters numPoints = 50; % Number of points in the vortex spinMagnitude = 0.5; % Magnitude of the spin vectors r1 = 1; ...

3 years ago | 1

Solved


Count collisions in an idealized block system
Two blocks, which have masses and , slide along a frictionless, semi-infinite track bounded by a stationary wall. Initially blo...

3 years ago

Answered
Generate a matrix with alternative positive and negative values with ones
n = 10; vec = (0:n-1)'; %Array A A = cospi(vec) %Array B vec0 = vec+4; B = 4*abs(vec0/8-floor(vec0/8+0.5))-1

3 years ago | 0

Solved


Next lexicographic - permutation
Find next lexicographic - permutation (permutations as it would occur in a dictionary order). E.g: nextP('ABCD') = ABDC If you...

3 years ago

Answered
How to add values from array A (n,3) to array B(m,2)based on values equality between m and n?
You can directly get the desired result - load('pathReduced.mat') load('pathInfo.mat') pathReduced inpath %Check which ele...

3 years ago | 0

| accepted

Answered
how to draw a 3D voxel / volumetric plot
Check out patch or PLOTCUBE

3 years ago | 0

Answered
How to enforce a certain symbolic expression to appear in Equation
syms go u W d f %relation of f with W, go rel = ((0.65*W)/go)-f==0; %Obtain W in terms of f and go (you can also get go i...

3 years ago | 0

Load more