Answered
How to not display warnings?
warning('off','MATLAB:singularMatrix')

4 years ago | 0

| accepted

Answered
How can I use a loop to save the output image of the program after each iteration?
for slice = 1:16 recon_img = senserecon(aliased_img, sen_map,reduc, fi_matrix); imwrite(recon_img,sprintf(...

4 years ago | 0

Answered
Separate multi-word comma separated cell into rows
C = { ... 'Business Name One[5],Business Name Two[3],Business Name Three[2]'; ... 'Business Name One[5]'; ... 'Bu...

4 years ago | 0

Answered
Is there a way to remove the mesh from an alphaShape plot?
shp1 = alphaShape(x1,y1,1); shp2 = alphaShape(x2,y2,1); p1 = plot(shp1,'FaceAlpha',0.5,'EdgeColor','none'); p2 = plot(shp2,...

4 years ago | 0

| accepted

Answered
How can I randomly select 1000 small matrix like 11X11 from 7081X7811 matrix size?
[A, R] = geotiffread('...tif'); %reading .tif image [row, col] = size(A); % row = 7081, col = 7811 N_small = 1000; sm...

4 years ago | 0

| accepted

Answered
Find the max value and its location in the first two dimensions of a 3-d matrix
a = cat(3,[1 2; 3 4],[8 7; 6 5]) [max_a,max_idx] = max(a,[],[1 2],'linear'); [max_row,max_col,~] = ind2sub(size(a),squeeze(max...

4 years ago | 0

| accepted

Answered
I created code in the command window but I could not write it as a function.
If you are going to write a function, you have to decide what its inputs and outputs are. Here I've put your code into four sep...

4 years ago | 1

| accepted

Answered
Matrix extension by inserting 0
k2 = 1; M1 = [k2 -k2 -k2 k2; 0 k2 k2 -k2; 0 0 k2 -k2; 0 0 0 k2]; M1_new = zeros(size(M1)+2); M1_new([1 2 5 6],[1 2 5 6]) = ...

4 years ago | 0

| accepted

Answered
How to concatenate lines in cell arrays
% 5-by-50 cell array, each cell containing a 1000-by-1 column vector: DATA = repmat({(1:1000).'},5,50); % combine all cells ...

4 years ago | 0

| accepted

Solved


find location of indexes
Given a vector with integer values. Find the edge location of the stream of same value. For example: A=[0 0 0 1 1 1 1 2 2 ...

4 years ago

Solved


Cell Operator *
Please implement operator * for cell: >> {2,3} * 2 ans = 1×4 cell array [2] [3] [2] [3] >> {2,3} * [2 3]...

4 years ago

Solved


Divide the Least Common Multiple by the Greatest Common Divisor of two numbers
Divide the Least Common Multiple by the Greatest Common Divisor of two numbers. For example, for x=12345 and y=54321, the answer...

4 years ago

Solved


time of day
Calculate the time of day in days, hours, minutes or seconds passed since the beginning of the day, depending on the unit. The u...

4 years ago

Solved


Count given word x in text.
Count how many times given word x repeats in text.

4 years ago

Solved


Find the missing numbers.
Total *N* numbers are in the series of natural numbers ( *1,2,3,...,N* ). The input is an array (unsorted) of those natural num...

4 years ago

Solved


Get factory-defined property values
Given a property name (e.g. 'AxesUnits', 'LineMarkerSize', 'UicontrolBackgroundColor'), return the factory-defined value for tha...

4 years ago

Answered
How to include values starting from the nth instance of a value?
bg_idx = find(strcmp(data_in(:,4),'Basket Glitch')); % include all the raw data up to the first instance of "Basket Glitch": ...

4 years ago | 1

| accepted

Answered
I get the following Error message: Not enough input values when I try to plot temp and depth
pros_data = readmatrix('forams_data.csv','DecimalSeparator',',') year = pros_data (:,1); %The year the data was taken depth = ...

4 years ago | 0

| accepted

Answered
Generate multiple matrix variables using loop
Here's an extract of an answer: c = cell(size(matrix)); for ii = 1:numel(matrix) a = matrix(ii).*vector + matrix; b ...

4 years ago | 0

Answered
how to save an image dataset into a specific folder
FileName = fullfile('D:\targetfolder',sprintf('%d.jpg',i)); imwrite(I,FileName,'jpg');

4 years ago | 0

| accepted

Answered
Multiple a matrix by every column of another matrix and stack the results in some form
I think this will do it: n = 10; A = 100+2*reshape(1:3*n,3,[]) B = reshape(1:3*6,3,[]) new_A = repmat(A,size(B,2),1); new_B...

4 years ago | 0

| accepted

Answered
How to make a signed value and using sprintf to display 3 value results
You can use as many %d, %i, or any other formatting operator as you need. And you can put a "+" right after "%" to make the sign...

4 years ago | 1

| accepted

Answered
How can I load multiple tiff files through a loop?
In place of the code you posted, do this: file_name_prefix = 'Research\MODIS\MOD11A1\MOD11A1.006_LST_Day_1km_doy20101'; for i ...

4 years ago | 0

Answered
How I can add a title in my correlation plot?
It looks like explicitly stating 'Visible','on' in the call to title() may make the title show up. I'm not sure why this is, sin...

4 years ago | 0

Answered
Can I change the width of a single bar in a bar plot?
Does the gap still appear too wide if you widen the bars? x = (1:7).'; y = rand(7,5); new_y = NaN(size(y)+[0 1]); new_y(:,[1...

4 years ago | 0

Answered
Rename files: keep only first 5 characters
You can use movefile() to rename files. Try something like this on a copy of your folder: pn = 'path\to\your\directory\'; f = ...

4 years ago | 2

| accepted

Answered
problems with "if statement"
A couple of people have pointed out that the "for k=1:NH" loop is not necessary, but since it is still part of the code, can you...

4 years ago | 0

Answered
Issues with while loop and answer plotting
Try putting a drawnow() in your code after the plots are created/updated in order to refresh the graphics.

4 years ago | 0

| accepted

Answered
Subscripting into a table using one subscript (as in t(i)) is not supported. Specify a row subscript and a variable subscript, as in t(rows,vars). To select variables, use t(:
The error seems to be happening because data is a (scalar) table, but the rest of the code was written to expect data to be an a...

4 years ago | 1

| accepted

Load more