Answered
Storing output of function file in workspace
Have the ParameterEstimates function return whatever outputs you need. In this case, I made it return Cfit. Then assign the out...

4 years ago | 0

| accepted

Answered
Display values barh, YEndPoints/XEndPoints does not work
Maybe you can use X/YData instead of X/YEndPoints. Here it is with labels on all bars; you can adapt it to label only the first ...

4 years ago | 1

| accepted

Answered
How to plot surf for 3D images.
unzip('h.zip') h = dicomread('./h/h.dcm'); whos h h = squeeze(h); whos h figure(); surf(h(:,:,1)) title('First Slice') c...

4 years ago | 0

Answered
How to set map limits on mapshow?
xlim / ylim seems to work here: % landAreas = readgeotable("landareas.shp"); %taken from MATLAB documentation...

4 years ago | 0

Answered
Display header along with data in excel using GUI
A = [12.7 5.02 -98 63.9 0 -.2 56]; B = [2 3 4 5 6 7 8]; % c= transpose([A;B]); c = num2cell(transpose([A;B])); % make c...

4 years ago | 0

Answered
How to create a 3 diagonal matrix with blocks
N = 7; M = zeros(2*N,N+2); M( 1+(2*N+2)*(0:N-1) + reshape([0 1]+[0;1;2]*2*N,[],1) ) = 1; disp(M);

4 years ago | 0

| accepted

Answered
How to change x-axis with boxplot
Like this? X = randn(100,82); boxplot(X) xt = 20:20:80; set(gca,'XTick',xt,'XTickLabel',xt); Or like this? xt = 20:20:80; ...

4 years ago | 0

| accepted

Answered
Generate a circular array of gridpoints inside a given contour.
Here's a function that fills an aribitrary contour (i.e., not necessarily a single circle) with random points (i.e., not necessa...

4 years ago | 0

Answered
Generate a circular array of gridpoints inside a given contour.
r = 1; x = linspace(-r,r,100); y = linspace(-r,r,100).'; figure [~,h] = contour(x,y,x.^2+y.^2, ... 'LevelList',r, ......

4 years ago | 0

| accepted

Answered
I have tried many different ways of plotting but it won't make a line graph can someone help me out?
Either: n = 100; for i = 1:n x = rand(); % ... % ... % plot(n,x); plot(i,x,'.'); ...

4 years ago | 0

Answered
How to store the strings in For loop in subsequent rows of an cell
% newstr = strjoin(w,";"); % instead of this newstr{i,1} = strjoin(w,";"); % do this

4 years ago | 0

| accepted

Answered
how can we construct different cells inside cell-array?
Perhaps a structure would be useful for storing that information: exp_info = struct( ... 'Date','2022.06.29', ... 'Na...

4 years ago | 0

| accepted

Answered
How to apply this for-loop containing '<', designed for a scalar array, to several scalar arrays in a cell array?
Wrap that loop in another loop: Cell = { rand(100,6); rand(100,6); rand(100,6); rand(100,6) }; for k = 1:numel(Cell) x ...

4 years ago | 1

Answered
How to draw Afghanistan Country flag?
imshow(imread('https://cdn.britannica.com/40/5340-004-B25ED5CF/Flag-Afghanistan.jpg'))

4 years ago | 0

Answered
count the # of rows of CSV files in a folder
your_folder = 'C:\path\to\folder'; files = dir(fullfile(your_folder,'*.csv')); fullFileNames = fullfile(your_folder,{files.n...

4 years ago | 0

| accepted

Answered
Axis rotation problem on the figure window
f = openfig('Axis_rotation_problem.fig'); figure(f) view([90 0]) camroll(90)

4 years ago | 0

| accepted

Answered
Importing data from specific columns of a data structure
T = readtable('data.txt') T(T.Date >= 20200101 & T.Date <= 20200103,:)

4 years ago | 0

| accepted

Answered
I have plotting question
Here's something, with random data for 5 stations. % replace this with your data, an 11x12 matrix: data = 6*rand(5,12)+2.5 % ...

4 years ago | 1

| accepted

Answered
How to apply S-box on input data?
A=0:7; Sbox=[0,1,3,6,7,4,5,2]; N = length(A); X=de2bi(A,3,'left-msb'); U=[]; % res=[]; % w1=[]; for i=1:N U(i,:)...

4 years ago | 0

| accepted

Answered
I have sensors values in the form of multiple csv's want to read each file and if the length is less than 800 take average of each column and insert in the last of csv
This will do that, including the first column (which you can continue to ignore): tmp=load('D:\Testing\1464882962.m_proc_gyro.c...

4 years ago | 0

| accepted

Answered
How to organize a matrix by fixed intervals to calculate mean
v_mean_10_plus = mean(velocidade(declive > 10)); v_mean_0_10 = mean(velocidade(declive <= 10 & declive >= 0)); v_mean_10_...

4 years ago | 1

| accepted

Answered
How to copy a matrix but skipping some row and column?
A = reshape(1:24^2,24,[]) to_skip = [1, 2, 4, 6, 8, 17, 19]; % one way B = A; % 'copy', then B(to_skip,:) = []...

4 years ago | 0

Answered
how I show all the numbers in y axes
Maybe something along these lines? clc clear close all; T=[2.12E-5, 2.13E-5, 2.15E-5, 2.33E-5, 3.36E-4, 6.03E-4, 6.11E-4, 6....

4 years ago | 0

| accepted

Answered
load and plot many .mat files in a loop
Try it like this Data=load(strcat(P,File3)); semilogx(tc,Data.Z3) Somehow you dropped off the .Z3 when you tried this Data=l...

4 years ago | 0

Answered
Sorting table row variables with number and letters
It seems like you can rearrange the rows by using the second output from sort. If the abc_0_xyz, etc., are the RowNames of the ...

4 years ago | 0

Answered
matrix points from a plot
The below includes code for making such a matrix and also a table of the same information (take whichever is more useful): load...

4 years ago | 1

Answered
Describe a colormap in the legend of a plot
values = 1000*rand(10); surface(1:10,1:10,values,'FaceColor','interp') box on grid on view(3); min_max = [min(values(:)) ...

4 years ago | 0

| accepted

Answered
How can I preallocate the matrix with size of column increase by eight on every loop of iteration?
E={[1,73,74,80,79,1,2,8,7] [2,74,75,81,80,2,3,9,8] [3,75,76,82,81,3,4,10,9] [4,76,77,83,82,4,5,11,10] [5,77,78,84,83,5,6,12,...

4 years ago | 0

| accepted

Answered
Index Matrix A and Matrix B Problems
A = [ 0, 1, 1, 0, 1, 0,1; 0, 0, 1, 1, 0, 0,0; 1, 1, 0, 1, 1, 0,0] B = [ 234, 59, 15, 99, 61, 74 ,71; 16, 27, 14, 13, 111, 345...

4 years ago | 0

Answered
is it possible to use "for loop" for matrix?
n = 2; X1=zeros(1,6); for k=1:6 for j=1:n X1(1,k)=(j^k)+X1(1,k); end end X1 % the way you have it now: ...

4 years ago | 1

Load more