フィルターのクリア

using google on matlab web browser

20 ビュー (過去 30 日間)
Rainaire Hansford
Rainaire Hansford 2019 年 12 月 8 日
コメント済み: Rainaire Hansford 2020 年 1 月 8 日
So I am trying to use the web browser for matlab using so far I have this code.
url = 'www.google.com';
web(url)
I'm to make a code where I would type some thing to sereach (Like you would with google) but using my matlab code and matlab browser.
Is there a way?
  2 件のコメント
per isakson
per isakson 2019 年 12 月 8 日
編集済み: per isakson 2019 年 12 月 8 日
Your code works for me (R2018b). It opens a google page in which I'm asked to accept some account related stuff. I guess, Google regards me as a new user.
Rainaire Hansford
Rainaire Hansford 2020 年 1 月 4 日
Sorry that not what I mean. I want to make a code where if I want to find something using google throught the matlab browers. Something like.
x=input('What would you like to find')
and i would input cat pictures. And somewhere in between here is the code im looking for.
url = 'www.google.com'
web(url)
and the web browers would appear with cat pictures using google.
That is what I am looking for. Sorry that wasn't clear.

サインインしてコメントする。

採用された回答

Jesus Sanchez
Jesus Sanchez 2020 年 1 月 5 日
You need to generate the complete url from matlab and then pass that to web(url). After a brief testing, the format for google search is
url = ['www.google.com/search?q=' search_target];
in search target, different words should be separated by '+', as this is how google works. You can check that yourself by searching something in google and looking at the url
Examples:
This only looks for cats:
search_target = 'cats';
url = ['www.google.com/search?q=' search_target];
web(url)
This looks for food recommendations for cats:
search_target = 'food+recomendations+for+cats';
url = ['www.google.com/search?q=' search_target];
web(url)
About introducing the "+" between words, you will need to distinguish between the different words that are part of the question and then add that between them.
  3 件のコメント
Jesus Sanchez
Jesus Sanchez 2020 年 1 月 6 日
編集済み: Jesus Sanchez 2020 年 1 月 6 日
It works fine for me. When I used the following code:
search_target = input('What would you like to find?')
url = ['www.google.com/search?q=' search_target];
web(url)
And as the input I wrote 'cat+pictures'. I also tried 'cat pictures' without the + and it seems to work right. However, do remember that the input should be between semicolons, as this is how matlab defines char arrays (only condition for all of this to work)
Rainaire Hansford
Rainaire Hansford 2020 年 1 月 8 日
Got it thank you so much man.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGoogle についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by