Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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...

fast 3 Jahre vor

Beantwortet
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...

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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);...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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)...

fast 3 Jahre vor | 0

Beantwortet
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)

fast 3 Jahre vor | 1

Beantwortet
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) ...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

fast 3 Jahre vor | 1

| akzeptiert

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

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
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'...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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*...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 3 Jahre vor | 0

Beantwortet
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...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
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

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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));...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
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])...

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 1

Gelöst


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...

fast 3 Jahre vor

Beantwortet
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

fast 3 Jahre vor | 0

Gelöst


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

fast 3 Jahre vor

Beantwortet
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...

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

Beantwortet
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...

fast 3 Jahre vor | 0

Mehr laden