Risposto
I want to change the spectrogram time scale from minutes to seconds but I am unsure how.
You can change the xticklabel: h = gca; h.XTickLabel = string(h.XTick * 60); xlabel('Time (s)'); Alternatively, compute the ...

circa 3 anni fa | 0

| accettato

Risposto
How to i convert complex single into complex double?
frame = single(3+4i); % Convert to double frame = double(frame) class(frame)

circa 3 anni fa | 0

Risolto


Go to the head of the class!
You're given a matrix and a single number. If that number is in the matrix, reorder the matrix so that number is in the first r...

circa 3 anni fa

Risolto


Toeplitize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

circa 3 anni fa

Risposto
What is the code for generating X(k) from given X(n) = [1 2 3 4] using Fast Fourier Transform?
x = [1 2 3 4]; xfft = fft(x) y = ifft(xfft)

circa 3 anni fa | 0

| accettato

Risposto
Dispay information for Button in AppDesigner
Use 'Tootip' property. k = uibutton('Text', 'TestTooltp', 'Tooltip', 'Show some information when hover over') The documentat...

circa 3 anni fa | 0

Risposto
How to see values in heatmap when we use subplot
Either increase the figure size or reduce the font size, or both: figure('Position', [0 0 1024 768]); subplot(2,2,1); a=rand(...

circa 3 anni fa | 0

| accettato

Risposto
set same ylim for all subplot (plot yy)
%% yyaxis plot x = linspace(0,10); y = sin(3*x); yyaxis left plot(x,y) z = sin(3*x).*exp(0.5*x); yyaxis right plot(x,z)...

circa 3 anni fa | 0

Risposto
Change stem colour of particular values
x = (1:66); y = randn(1, 66); % your data figure; hold on stem(x, y, 'r'); i1 = [39 53 59]; stem(x(i1), y(i1), 'g');

circa 3 anni fa | 0

Risposto
How to orient multiple STL files the same way?
%% clc clear close all figure(100) subplot(131) model = stlread('wristband_1.0.stl'); %Reads STL trimesh(model); %Plots...

circa 3 anni fa | 1

| accettato

Risposto
Using MATLAB and simulink, simulate the radiation pattern of an omnidirectional antenna
For ominidirectional response, it is a constant over directions. If you use phased array toolbox, you can plot the pattern: an...

circa 3 anni fa | 0

Risposto
How to find the percentage/number of pixels in each class of an indexed image?
Remove the nans before the line 'numberOfBins = max(fcls(:))'. This way the hist will not count on nans. fcls = fcls(:); fcls ...

circa 3 anni fa | 0

Risposto
How do I solve the double integral determined by the surface z=4x^2-y^2 over the rectangular region created by the coordinates (0,0),(4,0),(0,3) and (4,3) in the xy-plane?
You can do a numerical integration: z = integral2(@(x, y) 4*x.^2 - y.^2, 0, 4, 0, 3)

circa 3 anni fa | 1

| accettato

Risposto
How do I overlay worldmap outlines onto an imagesc plot?
You can use pcolorm instead of imagesc: % define and generate color plot x = [-180:5:180]; y = [10 5 0 -5 -10]; d1 = rand(5,...

circa 3 anni fa | 0

Risposto
how to interpolate for increasing - decreasing type of data set
Since tr1out is outside the range of theta1, you are doing extropolation as well. For the default interpolation method, the ext...

circa 3 anni fa | 0

Risposto
Make elements of matrix ones
A slightly simpler version: A = zeros(248,286); %create matrix of zeros A(20:60,[124:134 144:154 164:174]) = 1; A(70:120, [1...

circa 3 anni fa | 0

Risolto


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

circa 3 anni fa

Risolto


~~~~~~~ WAVE ~~~~~~~~~
|The WAVE generator| Once upon a time there was a river. 'Sum' was passing by the river. He saw the water of the river that w...

circa 3 anni fa

Risolto


Draw 'B'
Draw a x-by-x matrix 'B' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 0 1 0 0 0 1 ...

circa 3 anni fa

Risolto


Draw a 'N'!
Given n as input, generate a n-by-n matrix 'N' using 0 and 1 . Example: n=5 ans= [1 0 0 0 1 1 1 0 0 1 1 0 ...

circa 3 anni fa

Risolto


Draw 'C'.
Given x as input, generate a x-by-x matrix 'C' using 0 and 1. example: x=4 ans= [0 1 1 1 1 0 0 0 ...

circa 3 anni fa

Risolto


Draw 'H'
Draw a x-by-x matrix 'H' using 1 and 0. (x is odd and bigger than 2) Example: x=5 ans= [1 0 0 0 1 1 0 0 0 1 ...

circa 3 anni fa

Risolto


Draw 'J'
Given n as input, generate a n-by-n matrix 'J' using 0 and 1 . Example: n=5 ans= [0 0 0 0 1 0 0 0 0 1 0 0 ...

circa 3 anni fa

Risolto


Draw a 'X'!
Given n as input Draw a 'X' in a n-by-n matrix. example: n=3 y=[1 0 1 0 1 0 1 0 1] n=4 y=[1 0 0...

circa 3 anni fa

Risolto


Draw 'E'
Draw a x-by-x matrix 'E' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

circa 3 anni fa

Risolto


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

circa 3 anni fa

Risposto
Summarize three-way table
It could be something like this: % Assume table (T) with these variables: year, region, type_of_patents, regional_share % Fi...

circa 3 anni fa | 0

| accettato

Risposto
How to input image in array?
You can use cell array so that each cell stores an image (of different size). im{k} = imageArray;

circa 3 anni fa | 0

Risposto
Index exceeds the number of array elements (0)
aux = (find(b(:,q) >= 255)); % This could be empty if ~isempty(aux) FinalArray (q) = [aux(1)]; end

circa 3 anni fa | 0

| accettato

Risposto
array in power place minus known variable
Use .^ for power of an array of numbers. p = (10: .25: 15) I = 12.6 .^ (p-9.50 +2); plot(p,I)

circa 3 anni fa | 0

Carica altro