Answered

Save Excel cell range as image with activeX

With activex, you can do anything you can do with excel directly (as long as excel exposes it programmatically). So if you know ...

Save Excel cell range as image with activeX

With activex, you can do anything you can do with excel directly (as long as excel exposes it programmatically). So if you know ...

14 hours ago | 1

Answered

How to update variable names after a "clear"

Unfortunately, this is a limitation of matlab's editor. Note that clear x is exactly the same as clear('x') The former is t...

How to update variable names after a "clear"

Unfortunately, this is a limitation of matlab's editor. Note that clear x is exactly the same as clear('x') The former is t...

17 hours ago | 0

| accepted

Answered

how I can delete 1.0e+03 in my answer

format shortg %or format longg should fix your display issue.

how I can delete 1.0e+03 in my answer

format shortg %or format longg should fix your display issue.

1 day ago | 1

Answered

In memory calculations with tall arrays from different databases

If you have R2019a, you can combine your two datastores. ds_1 = tabularTextDatastore('file_1.txt'); ds_2 = tabularTextDatastor...

In memory calculations with tall arrays from different databases

If you have R2019a, you can combine your two datastores. ds_1 = tabularTextDatastore('file_1.txt'); ds_2 = tabularTextDatastor...

1 day ago | 1

Answered

Removing data from a structure that is less than a certain threshold

This code seems to run very slowly The code you've posted either doesn' do anything because the if condition is never true, or ...

Removing data from a structure that is less than a certain threshold

This code seems to run very slowly The code you've posted either doesn' do anything because the if condition is never true, or ...

1 day ago | 1

Answered

What will be the output of of CD(1:8:8*16)=ciphertext

It simply replaces elements 1,9,17, 25, ..., 121 of CD by the elements of ciphertext. Since that's 16 elements of CD that are re...

What will be the output of of CD(1:8:8*16)=ciphertext

It simply replaces elements 1,9,17, 25, ..., 121 of CD by the elements of ciphertext. Since that's 16 elements of CD that are re...

2 days ago | 1

| accepted

Answered

How to run macro in a different workbook

If the macro is supposed to act on the first workbook, the only way your excel procedure can work is if the macro rely on the Ac...

How to run macro in a different workbook

If the macro is supposed to act on the first workbook, the only way your excel procedure can work is if the macro rely on the Ac...

2 days ago | 2

| accepted

Answered

Sort Through Cell And Put Corresponding Values In Their Respective Rows

This is how I'd do it: data = readtable('ML_Q_1.xlsx', 'ReadVariableNames', false); %optionally, give better name to the varia...

Sort Through Cell And Put Corresponding Values In Their Respective Rows

This is how I'd do it: data = readtable('ML_Q_1.xlsx', 'ReadVariableNames', false); %optionally, give better name to the varia...

3 days ago | 1

| accepted

Answered

How to split a table based on date and hour

The easiest way is to use retime (requires a timetable) or groupsummary grouping by day, Of course, for matlab a day starts at 0...

How to split a table based on date and hour

The easiest way is to use retime (requires a timetable) or groupsummary grouping by day, Of course, for matlab a day starts at 0...

3 days ago | 2

| accepted

Answered

Write a program to calculate the probability of two fair dice having sum equal to 7. There are two fair dice and we are interested in seeing whether the sum of the two fair dice having sum equal to 7. Use Monte Carlo Simulation.

Everything is fine with your code (although the calculation of n7 and nAll could be done with no loop at all), except for your c...

Write a program to calculate the probability of two fair dice having sum equal to 7. There are two fair dice and we are interested in seeing whether the sum of the two fair dice having sum equal to 7. Use Monte Carlo Simulation.

Everything is fine with your code (although the calculation of n7 and nAll could be done with no loop at all), except for your c...

3 days ago | 1

| accepted

Answered

Dot indexing is not supported for variables of this type in a for loop

Typically, you'll get this error because the structure or object you're indexing with . is empty. Indeed, you have this bit of ...

Dot indexing is not supported for variables of this type in a for loop

Typically, you'll get this error because the structure or object you're indexing with . is empty. Indeed, you have this bit of ...

4 days ago | 0

Answered

How can I create a (printable) image (jpeg, bitmap, tiff...any format is ok) starting from a binary code?

I understood that it's an art project but I'm worried that you're going to be disappointed with the results if you don't come up...

How can I create a (printable) image (jpeg, bitmap, tiff...any format is ok) starting from a binary code?

I understood that it's an art project but I'm worried that you're going to be disappointed with the results if you don't come up...

4 days ago | 0

Answered

please help me run this code, as i am unable to solve an error.

There are a few issues with your code: you correctly query the size of your image and use that to preallocate your arrays, th...

please help me run this code, as i am unable to solve an error.

There are a few issues with your code: you correctly query the size of your image and use that to preallocate your arrays, th...

4 days ago | 2

| accepted

Answered

Keep positive real values from a cell inside a matrix

I want to scatter all the positive real values of every cell In that case, I would convert your cell array to a 3D matrix. As I...

Keep positive real values from a cell inside a matrix

I want to scatter all the positive real values of every cell In that case, I would convert your cell array to a 3D matrix. As I...

6 days ago | 0

| accepted

Answered

Swapping Letters Using Regular Expression

>> text = {'Fred', 'Replace', 'Cannot'}; >> regexprep(text, '([^aeiou]*)([aeiou])(.*)', '$1$3$2') ans = 1×3 cell array ...

Swapping Letters Using Regular Expression

>> text = {'Fred', 'Replace', 'Cannot'}; >> regexprep(text, '([^aeiou]*)([aeiou])(.*)', '$1$3$2') ans = 1×3 cell array ...

6 days ago | 0

| accepted

Answered

How to state that at least 80% of the values in my vector need to be positive

if mean(yourvector(150:end) > 0) >= 0.8 %assuming positive means strictly greater than 0 startindex = find(yourvector(150:...

How to state that at least 80% of the values in my vector need to be positive

if mean(yourvector(150:end) > 0) >= 0.8 %assuming positive means strictly greater than 0 startindex = find(yourvector(150:...

6 days ago | 0

Answered

How to remove all the rows if first two columns has same number?

Two of many possible ways: yourmatrix(diff(yourmatrix(:, [1 2]), [], 2) == 0 , :) = []; yourmatrix(yourmatrix(:, 1) == yourm...

How to remove all the rows if first two columns has same number?

Two of many possible ways: yourmatrix(diff(yourmatrix(:, [1 2]), [], 2) == 0 , :) = []; yourmatrix(yourmatrix(:, 1) == yourm...

6 days ago | 0

| accepted

Answered

How to use Uniquetol without sorting?

[~, colindices] = uniquetol(A', 1e-6, 'ByRows', true); %get indices of unique value. Is sorted BY VALUE B = A(:, sort(colindi...

How to use Uniquetol without sorting?

[~, colindices] = uniquetol(A', 1e-6, 'ByRows', true); %get indices of unique value. Is sorted BY VALUE B = A(:, sort(colindi...

6 days ago | 0

| accepted

Answered

how binary floating point to real decimal number representation ?

Yes, as Stephen said, be careful about the difference between binary numbers and IEEE storage. You can easily see the IEEE repre...

how binary floating point to real decimal number representation ?

Yes, as Stephen said, be careful about the difference between binary numbers and IEEE storage. You can easily see the IEEE repre...

6 days ago | 2

| accepted

Answered

Interaction between MATLAB 32bit and MATLAB 64bit

I'm not clear why step 1 requires a particular bitness. The majority of databases will provide a 32-bit and 64-bit ODBC driver. ...

Interaction between MATLAB 32bit and MATLAB 64bit

I'm not clear why step 1 requires a particular bitness. The majority of databases will provide a 32-bit and 64-bit ODBC driver. ...

6 days ago | 0

Answered

Certain functions not available.

The answer to why you cannot use ischange in R2017a is simple. As written at the bottom of its documentation, it was introduced ...

Certain functions not available.

The answer to why you cannot use ischange in R2017a is simple. As written at the bottom of its documentation, it was introduced ...

7 days ago | 0

Answered

ismember(A,B,'rows') indexing

If the two cell arrays don't have the same number of columns, you're obviously not using ismember(A, B, 'rows') but something sl...

ismember(A,B,'rows') indexing

If the two cell arrays don't have the same number of columns, you're obviously not using ismember(A, B, 'rows') but something sl...

7 days ago | 0

Answered

Subtract according to the values in another column

one way: C1 = [1 1 1 1 1 2 2 2 2 2 2 3 3 3 4 4 4 4] %this is valid matlab syntax C2 = [5 10 12 35 3 1 4 26 5 11 12 8 2...

Subtract according to the values in another column

one way: C1 = [1 1 1 1 1 2 2 2 2 2 2 3 3 3 4 4 4 4] %this is valid matlab syntax C2 = [5 10 12 35 3 1 4 26 5 11 12 8 2...

7 days ago | 0

| accepted

Answered

Plotting the orientation of lines

Not entirely sure what you're after, is it something like: A = [99.1862290400000 102.281400300000 97.1587243900000 ...

Plotting the orientation of lines

Not entirely sure what you're after, is it something like: A = [99.1862290400000 102.281400300000 97.1587243900000 ...

8 days ago | 0

Answered

Loading Text Files to Run as the Commands in a Function

Ignoring the fact that running arbitrary code is rarely a good idea, the simplest way to achieve what you want is to save your t...

Loading Text Files to Run as the Commands in a Function

Ignoring the fact that running arbitrary code is rarely a good idea, the simplest way to achieve what you want is to save your t...

8 days ago | 0

Answered

elimination of the chosen elements and rearranging the matrix

Deleting elements of an array while you iterate over elements of an array is never going to work. In any case, a loop is not n...

elimination of the chosen elements and rearranging the matrix

Deleting elements of an array while you iterate over elements of an array is never going to work. In any case, a loop is not n...

8 days ago | 2

| accepted

Answered

Creating multiple plots from a data file using a for loop

I see you've solved your problem, but for future reference the problem had nothing to do with plot. The problem was with your in...

Creating multiple plots from a data file using a for loop

I see you've solved your problem, but for future reference the problem had nothing to do with plot. The problem was with your in...

8 days ago | 0

| accepted

Answered

html and uitable formatting with several features at the same time

If you're talking about uitable within a uifigure, then it does not support html formatting. See https://www.mathworks.com/matla...

html and uitable formatting with several features at the same time

If you're talking about uitable within a uifigure, then it does not support html formatting. See https://www.mathworks.com/matla...

8 days ago | 0

Answered

Adjacency matrix formation from n*n matrix

edgeData = [A, W(:)] Note that this is not an adjacency matrix. Also, you may actually want to input that into a graph or digr...

Adjacency matrix formation from n*n matrix

edgeData = [A, W(:)] Note that this is not an adjacency matrix. Also, you may actually want to input that into a graph or digr...

8 days ago | 0

| accepted

Answered

Find monthly mean from daily data of same year using find function

The easiest way: data = readtimetable('C:\somewhere\somefile.xlsx'); %may need some adjustement depending on the actual format...

Find monthly mean from daily data of same year using find function

The easiest way: data = readtimetable('C:\somewhere\somefile.xlsx'); %may need some adjustement depending on the actual format...

8 days ago | 0