Risposto
How to call a function within ax=gca format
This seems to be impossible. The closest I came was the code below. c = @cmu.colors; col=c('deep carrot orange');%returns this...

quasi 6 anni fa | 0

| accettato

Risposto
for loop & saving tables
The easiest way is to read the excel file, append the new results and write the newly expanded cell array. Alternatively you ca...

quasi 6 anni fa | 0

| accettato

Risposto
running an external program by changing input text file for every iteration in windows.
This should do the trick for you: % ------ open files and read the data in an array -------------- clc; clear; fid = fopen('i...

quasi 6 anni fa | 1

| accettato

Risposto
All the combinations of sums of rows of matrices
The order is not the same as you stated, but this will work: A=[... 1 0 2 1 2 4 1 3 0 1 3 2]; ...

quasi 6 anni fa | 1

Risposto
How to run multiple iterations while increasing the index?
The easiest way to do this is to standardize the bins. If you don't want that, you should probably use a cell array. for n=1...

quasi 6 anni fa | 0

| accettato

Risposto
Adding cell array values across column
It looks like you can simply convert to a normal matrix (and back): A={your_cell}; A=cell2mat(A); A=sum(A,1); A=num2cell(A);...

quasi 6 anni fa | 1

| accettato

Risposto
calculation of average and difference from imported data
Well, if that is the input, then this edit to your function should work: function P = damage(time,stress) a = 2.416; b = 0....

quasi 6 anni fa | 2

Risposto
I have a question about using table
You should use a different syntax: class(test) Your current syntax is equivalent to class('test')

quasi 6 anni fa | 0

| accettato

Risposto
Is it possible to group if-end code in the same way as a for loop?
Yes, look in the preferences:

quasi 6 anni fa | 0

| accettato

Risposto
How can i select all the same codes in a function at once while MATLAB only highlights them that they are same code?
Since they have no relation to the variables in other functions, you can't. It is possible if it is a function call. So a worka...

quasi 6 anni fa | 0

| accettato

Risposto
Write unicode flag to text file
Matlab stores characters internally in a uint16. That means only your first character is supported: isvalidchar = double(uint16...

quasi 6 anni fa | 2

| accettato

Risposto
Write a function called valid_date that takes three positive integer scalar inputs year, month, day. If these three represent a valid date, return a logical true, otherwise false. The name of the output argument is valid. If any of the inputs is not
There are two things I notice in your code: You don't test anywhere whether the input is a scalar or a vector/array. Your leap...

quasi 6 anni fa | 0

| accettato

Risposto
find expression within {}
You were close: you forgot to make the expression lazy, and you forgot you included the close bracket from the sting when exclud...

quasi 6 anni fa | 0

| accettato

Risposto
Compute the minimum distance between each element in a vector with another larger array
I don't think there is a way around doing some calculation for each pair. Is there a way to vectorize distance_latlon? If not, ...

quasi 6 anni fa | 1

| accettato

Risposto
Are Ryzen-5 4600H processor support Matlab.
There was an issue with an instruction set not being used. This is now fixed, at least for R2020a (and a workaround solution exi...

quasi 6 anni fa | 0

Risposto
Finding the number of datapoints in a text file
It looks like you can look for the line with '[data]' on it, and continue until the first line that doesn't start with a digit o...

quasi 6 anni fa | 1

| accettato

Risposto
Is it possible to save plotted points?
Either save the data you use to create the plot, or retrieve that data from the XData and YData properties of the line object cr...

quasi 6 anni fa | 0

Risposto
Problem with plotting an anonymous function
Let's first make the terms more readable: calka1 = @(X)(integral(@(x)((... x.*(-1.15517395637196e-2)... +x.^2.*5.2577...

quasi 6 anni fa | 1

Risposto
create a new variable that is the product of lag value of another variable and its own lag value
survival=cumprod(1-mortality);

quasi 6 anni fa | 1

| accettato

Risposto
How to make a matrix has more pixels?
If you want to increase the size of the black and white parts in equal proportion, you can use the repelem function.

quasi 6 anni fa | 0

| accettato

Risposto
omit for-loop per arrayfun function
I doubt arrayfun will cause the speed-up you're hoping for. It has its own overhead, so it might even be slower. Functions like ...

quasi 6 anni fa | 1

| accettato

Risposto
Copy If greater than column value
Use rowfun or a loop. Your current logical statement is checking all rows at once.

quasi 6 anni fa | 0

| accettato

Risposto
Compare Strings in a loop
If you know the number of interations, why not use a for loop again? for k = 1:size(data.CellA,1) %use size(___,dim) instead of...

quasi 6 anni fa | 0

| accettato

Risposto
How to find the string on .txt
Use strfind to find the start of a string, then use the length of the input to generate all indices.

quasi 6 anni fa | 0

Risposto
Making a software / GUI that is able to save data and change itself.
The things you mention are all possible. For general advice and examples for how to create a GUI (and avoid using GUIDE), have l...

quasi 6 anni fa | 0

Risposto
Plot for different conditions of function
Your code is plotting scalars. If you want to see a line you should put in multiple values at the same time. for x=-30:1:30 if...

quasi 6 anni fa | 0

| accettato

Risposto
How to change the Author name in my account?
Go to https://www.mathworks.com/mwaccount/profiles/edit and click the community tab. You can change your nickname there.

quasi 6 anni fa | 0

Risposto
How can I display boxplots and subplots in different windows?
You can provide explicit handles for most graphics calls. qqplot is one of the exceptions. How you can deal with them is shown b...

quasi 6 anni fa | 0

Risposto
Standalone compilation and use of GUI app
Yes. You asked Matlab to include the txt file, so it did. If you don't want to include it in the packaged app, you shouldn't add...

quasi 6 anni fa | 0

Carica altro